1#![doc = "MAVLink ASLUAV dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{
10 bytes::Bytes, bytes_mut::BytesMut, types::CharArray, MavlinkVersion, Message, MessageData,
11};
12#[allow(unused_imports)]
13use num_derive::FromPrimitive;
14#[allow(unused_imports)]
15use num_derive::ToPrimitive;
16#[allow(unused_imports)]
17use num_traits::FromPrimitive;
18#[allow(unused_imports)]
19use num_traits::ToPrimitive;
20#[cfg(feature = "serde")]
21use serde::{Deserialize, Serialize};
22#[cfg(feature = "ts")]
23use ts_rs::TS;
24pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
25#[cfg_attr(feature = "ts", derive(TS))]
26#[cfg_attr(feature = "ts", ts(export))]
27#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
28#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29#[cfg_attr(feature = "serde", serde(tag = "type"))]
30#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31#[repr(u32)]
32#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
33pub enum ActuatorConfiguration {
34 #[doc = "Do nothing."]
35 ACTUATOR_CONFIGURATION_NONE = 0,
36 #[doc = "Command the actuator to beep now."]
37 ACTUATOR_CONFIGURATION_BEEP = 1,
38 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
39 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
40 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
41 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
42 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
43 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
44 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
45 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
46}
47impl ActuatorConfiguration {
48 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
49}
50impl Default for ActuatorConfiguration {
51 fn default() -> Self {
52 Self::DEFAULT
53 }
54}
55#[cfg_attr(feature = "ts", derive(TS))]
56#[cfg_attr(feature = "ts", ts(export))]
57#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
58#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
59#[cfg_attr(feature = "serde", serde(tag = "type"))]
60#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
61#[repr(u32)]
62#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
63pub enum ActuatorOutputFunction {
64 #[doc = "No function (disabled)."]
65 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
66 #[doc = "Motor 1"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
68 #[doc = "Motor 2"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
70 #[doc = "Motor 3"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
72 #[doc = "Motor 4"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
74 #[doc = "Motor 5"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
76 #[doc = "Motor 6"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
78 #[doc = "Motor 7"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
80 #[doc = "Motor 8"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
82 #[doc = "Motor 9"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
84 #[doc = "Motor 10"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
86 #[doc = "Motor 11"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
88 #[doc = "Motor 12"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
90 #[doc = "Motor 13"]
91 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
92 #[doc = "Motor 14"]
93 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
94 #[doc = "Motor 15"]
95 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
96 #[doc = "Motor 16"]
97 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
98 #[doc = "Servo 1"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
100 #[doc = "Servo 2"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
102 #[doc = "Servo 3"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
104 #[doc = "Servo 4"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
106 #[doc = "Servo 5"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
108 #[doc = "Servo 6"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
110 #[doc = "Servo 7"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
112 #[doc = "Servo 8"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
114 #[doc = "Servo 9"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
116 #[doc = "Servo 10"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
118 #[doc = "Servo 11"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
120 #[doc = "Servo 12"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
122 #[doc = "Servo 13"]
123 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
124 #[doc = "Servo 14"]
125 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
126 #[doc = "Servo 15"]
127 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
128 #[doc = "Servo 16"]
129 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
130}
131impl ActuatorOutputFunction {
132 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
133}
134impl Default for ActuatorOutputFunction {
135 fn default() -> Self {
136 Self::DEFAULT
137 }
138}
139#[cfg_attr(feature = "ts", derive(TS))]
140#[cfg_attr(feature = "ts", ts(export))]
141#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
143#[cfg_attr(feature = "serde", serde(tag = "type"))]
144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
145#[repr(u32)]
146#[doc = "Enumeration of the ADSB altimeter types"]
147pub enum AdsbAltitudeType {
148 #[doc = "Altitude reported from a Baro source using QNH reference"]
149 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
150 #[doc = "Altitude reported from a GNSS source"]
151 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
152}
153impl AdsbAltitudeType {
154 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
155}
156impl Default for AdsbAltitudeType {
157 fn default() -> Self {
158 Self::DEFAULT
159 }
160}
161#[cfg_attr(feature = "ts", derive(TS))]
162#[cfg_attr(feature = "ts", ts(export))]
163#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
164#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
165#[cfg_attr(feature = "serde", serde(tag = "type"))]
166#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
167#[repr(u32)]
168#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
169pub enum AdsbEmitterType {
170 ADSB_EMITTER_TYPE_NO_INFO = 0,
171 ADSB_EMITTER_TYPE_LIGHT = 1,
172 ADSB_EMITTER_TYPE_SMALL = 2,
173 ADSB_EMITTER_TYPE_LARGE = 3,
174 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
175 ADSB_EMITTER_TYPE_HEAVY = 5,
176 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
177 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
178 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
179 ADSB_EMITTER_TYPE_GLIDER = 9,
180 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
181 ADSB_EMITTER_TYPE_PARACHUTE = 11,
182 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
183 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
184 ADSB_EMITTER_TYPE_UAV = 14,
185 ADSB_EMITTER_TYPE_SPACE = 15,
186 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
187 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
188 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
189 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
190}
191impl AdsbEmitterType {
192 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
193}
194impl Default for AdsbEmitterType {
195 fn default() -> Self {
196 Self::DEFAULT
197 }
198}
199bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
200impl AdsbFlags {
201 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
202}
203impl Default for AdsbFlags {
204 fn default() -> Self {
205 Self::DEFAULT
206 }
207}
208bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
209impl AisFlags {
210 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
211}
212impl Default for AisFlags {
213 fn default() -> Self {
214 Self::DEFAULT
215 }
216}
217#[cfg_attr(feature = "ts", derive(TS))]
218#[cfg_attr(feature = "ts", ts(export))]
219#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
220#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
221#[cfg_attr(feature = "serde", serde(tag = "type"))]
222#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
223#[repr(u32)]
224#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
225pub enum AisNavStatus {
226 #[doc = "Under way using engine."]
227 UNDER_WAY = 0,
228 AIS_NAV_ANCHORED = 1,
229 AIS_NAV_UN_COMMANDED = 2,
230 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
231 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
232 AIS_NAV_MOORED = 5,
233 AIS_NAV_AGROUND = 6,
234 AIS_NAV_FISHING = 7,
235 AIS_NAV_SAILING = 8,
236 AIS_NAV_RESERVED_HSC = 9,
237 AIS_NAV_RESERVED_WIG = 10,
238 AIS_NAV_RESERVED_1 = 11,
239 AIS_NAV_RESERVED_2 = 12,
240 AIS_NAV_RESERVED_3 = 13,
241 #[doc = "Search And Rescue Transponder."]
242 AIS_NAV_AIS_SART = 14,
243 #[doc = "Not available (default)."]
244 AIS_NAV_UNKNOWN = 15,
245}
246impl AisNavStatus {
247 pub const DEFAULT: Self = Self::UNDER_WAY;
248}
249impl Default for AisNavStatus {
250 fn default() -> Self {
251 Self::DEFAULT
252 }
253}
254#[cfg_attr(feature = "ts", derive(TS))]
255#[cfg_attr(feature = "ts", ts(export))]
256#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
257#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
258#[cfg_attr(feature = "serde", serde(tag = "type"))]
259#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
260#[repr(u32)]
261#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
262pub enum AisType {
263 #[doc = "Not available (default)."]
264 AIS_TYPE_UNKNOWN = 0,
265 AIS_TYPE_RESERVED_1 = 1,
266 AIS_TYPE_RESERVED_2 = 2,
267 AIS_TYPE_RESERVED_3 = 3,
268 AIS_TYPE_RESERVED_4 = 4,
269 AIS_TYPE_RESERVED_5 = 5,
270 AIS_TYPE_RESERVED_6 = 6,
271 AIS_TYPE_RESERVED_7 = 7,
272 AIS_TYPE_RESERVED_8 = 8,
273 AIS_TYPE_RESERVED_9 = 9,
274 AIS_TYPE_RESERVED_10 = 10,
275 AIS_TYPE_RESERVED_11 = 11,
276 AIS_TYPE_RESERVED_12 = 12,
277 AIS_TYPE_RESERVED_13 = 13,
278 AIS_TYPE_RESERVED_14 = 14,
279 AIS_TYPE_RESERVED_15 = 15,
280 AIS_TYPE_RESERVED_16 = 16,
281 AIS_TYPE_RESERVED_17 = 17,
282 AIS_TYPE_RESERVED_18 = 18,
283 AIS_TYPE_RESERVED_19 = 19,
284 #[doc = "Wing In Ground effect."]
285 AIS_TYPE_WIG = 20,
286 AIS_TYPE_WIG_HAZARDOUS_A = 21,
287 AIS_TYPE_WIG_HAZARDOUS_B = 22,
288 AIS_TYPE_WIG_HAZARDOUS_C = 23,
289 AIS_TYPE_WIG_HAZARDOUS_D = 24,
290 AIS_TYPE_WIG_RESERVED_1 = 25,
291 AIS_TYPE_WIG_RESERVED_2 = 26,
292 AIS_TYPE_WIG_RESERVED_3 = 27,
293 AIS_TYPE_WIG_RESERVED_4 = 28,
294 AIS_TYPE_WIG_RESERVED_5 = 29,
295 AIS_TYPE_FISHING = 30,
296 AIS_TYPE_TOWING = 31,
297 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
298 AIS_TYPE_TOWING_LARGE = 32,
299 #[doc = "Dredging or other underwater ops."]
300 AIS_TYPE_DREDGING = 33,
301 AIS_TYPE_DIVING = 34,
302 AIS_TYPE_MILITARY = 35,
303 AIS_TYPE_SAILING = 36,
304 AIS_TYPE_PLEASURE = 37,
305 AIS_TYPE_RESERVED_20 = 38,
306 AIS_TYPE_RESERVED_21 = 39,
307 #[doc = "High Speed Craft."]
308 AIS_TYPE_HSC = 40,
309 AIS_TYPE_HSC_HAZARDOUS_A = 41,
310 AIS_TYPE_HSC_HAZARDOUS_B = 42,
311 AIS_TYPE_HSC_HAZARDOUS_C = 43,
312 AIS_TYPE_HSC_HAZARDOUS_D = 44,
313 AIS_TYPE_HSC_RESERVED_1 = 45,
314 AIS_TYPE_HSC_RESERVED_2 = 46,
315 AIS_TYPE_HSC_RESERVED_3 = 47,
316 AIS_TYPE_HSC_RESERVED_4 = 48,
317 AIS_TYPE_HSC_UNKNOWN = 49,
318 AIS_TYPE_PILOT = 50,
319 #[doc = "Search And Rescue vessel."]
320 AIS_TYPE_SAR = 51,
321 AIS_TYPE_TUG = 52,
322 AIS_TYPE_PORT_TENDER = 53,
323 #[doc = "Anti-pollution equipment."]
324 AIS_TYPE_ANTI_POLLUTION = 54,
325 AIS_TYPE_LAW_ENFORCEMENT = 55,
326 AIS_TYPE_SPARE_LOCAL_1 = 56,
327 AIS_TYPE_SPARE_LOCAL_2 = 57,
328 AIS_TYPE_MEDICAL_TRANSPORT = 58,
329 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
330 AIS_TYPE_NONECOMBATANT = 59,
331 AIS_TYPE_PASSENGER = 60,
332 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
333 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
334 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
335 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
336 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
337 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
338 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
339 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
340 AIS_TYPE_PASSENGER_UNKNOWN = 69,
341 AIS_TYPE_CARGO = 70,
342 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
343 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
344 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
345 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
346 AIS_TYPE_CARGO_RESERVED_1 = 75,
347 AIS_TYPE_CARGO_RESERVED_2 = 76,
348 AIS_TYPE_CARGO_RESERVED_3 = 77,
349 AIS_TYPE_CARGO_RESERVED_4 = 78,
350 AIS_TYPE_CARGO_UNKNOWN = 79,
351 AIS_TYPE_TANKER = 80,
352 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
353 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
354 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
355 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
356 AIS_TYPE_TANKER_RESERVED_1 = 85,
357 AIS_TYPE_TANKER_RESERVED_2 = 86,
358 AIS_TYPE_TANKER_RESERVED_3 = 87,
359 AIS_TYPE_TANKER_RESERVED_4 = 88,
360 AIS_TYPE_TANKER_UNKNOWN = 89,
361 AIS_TYPE_OTHER = 90,
362 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
363 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
364 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
365 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
366 AIS_TYPE_OTHER_RESERVED_1 = 95,
367 AIS_TYPE_OTHER_RESERVED_2 = 96,
368 AIS_TYPE_OTHER_RESERVED_3 = 97,
369 AIS_TYPE_OTHER_RESERVED_4 = 98,
370 AIS_TYPE_OTHER_UNKNOWN = 99,
371}
372impl AisType {
373 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
374}
375impl Default for AisType {
376 fn default() -> Self {
377 Self::DEFAULT
378 }
379}
380bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
381impl AttitudeTargetTypemask {
382 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
383}
384impl Default for AttitudeTargetTypemask {
385 fn default() -> Self {
386 Self::DEFAULT
387 }
388}
389#[cfg_attr(feature = "ts", derive(TS))]
390#[cfg_attr(feature = "ts", ts(export))]
391#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
392#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
393#[cfg_attr(feature = "serde", serde(tag = "type"))]
394#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
395#[repr(u32)]
396#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
397pub enum AutotuneAxis {
398 #[doc = "Autotune roll axis."]
399 AUTOTUNE_AXIS_ROLL = 1,
400 #[doc = "Autotune pitch axis."]
401 AUTOTUNE_AXIS_PITCH = 2,
402 #[doc = "Autotune yaw axis."]
403 AUTOTUNE_AXIS_YAW = 4,
404}
405impl AutotuneAxis {
406 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
407}
408impl Default for AutotuneAxis {
409 fn default() -> Self {
410 Self::DEFAULT
411 }
412}
413bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
414impl CameraCapFlags {
415 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
416}
417impl Default for CameraCapFlags {
418 fn default() -> Self {
419 Self::DEFAULT
420 }
421}
422#[cfg_attr(feature = "ts", derive(TS))]
423#[cfg_attr(feature = "ts", ts(export))]
424#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
425#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
426#[cfg_attr(feature = "serde", serde(tag = "type"))]
427#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
428#[repr(u32)]
429#[doc = "Camera Modes."]
430pub enum CameraMode {
431 #[doc = "Camera is in image/photo capture mode."]
432 CAMERA_MODE_IMAGE = 0,
433 #[doc = "Camera is in video capture mode."]
434 CAMERA_MODE_VIDEO = 1,
435 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
436 CAMERA_MODE_IMAGE_SURVEY = 2,
437}
438impl CameraMode {
439 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
440}
441impl Default for CameraMode {
442 fn default() -> Self {
443 Self::DEFAULT
444 }
445}
446#[cfg_attr(feature = "ts", derive(TS))]
447#[cfg_attr(feature = "ts", ts(export))]
448#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
449#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
450#[cfg_attr(feature = "serde", serde(tag = "type"))]
451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
452#[repr(u32)]
453#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
454pub enum CameraSource {
455 #[doc = "Default camera source."]
456 CAMERA_SOURCE_DEFAULT = 0,
457 #[doc = "RGB camera source."]
458 CAMERA_SOURCE_RGB = 1,
459 #[doc = "IR camera source."]
460 CAMERA_SOURCE_IR = 2,
461 #[doc = "NDVI camera source."]
462 CAMERA_SOURCE_NDVI = 3,
463}
464impl CameraSource {
465 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
466}
467impl Default for CameraSource {
468 fn default() -> Self {
469 Self::DEFAULT
470 }
471}
472#[cfg_attr(feature = "ts", derive(TS))]
473#[cfg_attr(feature = "ts", ts(export))]
474#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
476#[cfg_attr(feature = "serde", serde(tag = "type"))]
477#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
478#[repr(u32)]
479#[doc = "Camera tracking modes"]
480pub enum CameraTrackingMode {
481 #[doc = "Not tracking"]
482 CAMERA_TRACKING_MODE_NONE = 0,
483 #[doc = "Target is a point"]
484 CAMERA_TRACKING_MODE_POINT = 1,
485 #[doc = "Target is a rectangle"]
486 CAMERA_TRACKING_MODE_RECTANGLE = 2,
487}
488impl CameraTrackingMode {
489 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
490}
491impl Default for CameraTrackingMode {
492 fn default() -> Self {
493 Self::DEFAULT
494 }
495}
496#[cfg_attr(feature = "ts", derive(TS))]
497#[cfg_attr(feature = "ts", ts(export))]
498#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
499#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
500#[cfg_attr(feature = "serde", serde(tag = "type"))]
501#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
502#[repr(u32)]
503#[doc = "Camera tracking status flags"]
504pub enum CameraTrackingStatusFlags {
505 #[doc = "Camera is not tracking"]
506 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
507 #[doc = "Camera is tracking"]
508 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
509 #[doc = "Camera tracking in error state"]
510 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
511}
512impl CameraTrackingStatusFlags {
513 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
514}
515impl Default for CameraTrackingStatusFlags {
516 fn default() -> Self {
517 Self::DEFAULT
518 }
519}
520bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
521impl CameraTrackingTargetData {
522 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
523}
524impl Default for CameraTrackingTargetData {
525 fn default() -> Self {
526 Self::DEFAULT
527 }
528}
529#[cfg_attr(feature = "ts", derive(TS))]
530#[cfg_attr(feature = "ts", ts(export))]
531#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
532#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
533#[cfg_attr(feature = "serde", serde(tag = "type"))]
534#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
535#[repr(u32)]
536#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
537pub enum CameraZoomType {
538 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
539 ZOOM_TYPE_STEP = 0,
540 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
541 ZOOM_TYPE_CONTINUOUS = 1,
542 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
543 ZOOM_TYPE_RANGE = 2,
544 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
545 ZOOM_TYPE_FOCAL_LENGTH = 3,
546 #[doc = "Zoom value as horizontal field of view in degrees."]
547 ZOOM_TYPE_HORIZONTAL_FOV = 4,
548}
549impl CameraZoomType {
550 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
551}
552impl Default for CameraZoomType {
553 fn default() -> Self {
554 Self::DEFAULT
555 }
556}
557#[cfg_attr(feature = "ts", derive(TS))]
558#[cfg_attr(feature = "ts", ts(export))]
559#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
560#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
561#[cfg_attr(feature = "serde", serde(tag = "type"))]
562#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
563#[repr(u32)]
564pub enum CanFilterOp {
565 CAN_FILTER_REPLACE = 0,
566 CAN_FILTER_ADD = 1,
567 CAN_FILTER_REMOVE = 2,
568}
569impl CanFilterOp {
570 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
571}
572impl Default for CanFilterOp {
573 fn default() -> Self {
574 Self::DEFAULT
575 }
576}
577#[cfg_attr(feature = "ts", derive(TS))]
578#[cfg_attr(feature = "ts", ts(export))]
579#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
580#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
581#[cfg_attr(feature = "serde", serde(tag = "type"))]
582#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
583#[repr(u32)]
584#[doc = "Possible responses from a CELLULAR_CONFIG message."]
585pub enum CellularConfigResponse {
586 #[doc = "Changes accepted."]
587 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
588 #[doc = "Invalid APN."]
589 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
590 #[doc = "Invalid PIN."]
591 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
592 #[doc = "Changes rejected."]
593 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
594 #[doc = "PUK is required to unblock SIM card."]
595 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
596}
597impl CellularConfigResponse {
598 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
599}
600impl Default for CellularConfigResponse {
601 fn default() -> Self {
602 Self::DEFAULT
603 }
604}
605#[cfg_attr(feature = "ts", derive(TS))]
606#[cfg_attr(feature = "ts", ts(export))]
607#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
609#[cfg_attr(feature = "serde", serde(tag = "type"))]
610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
611#[repr(u32)]
612#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
613pub enum CellularNetworkFailedReason {
614 #[doc = "No error"]
615 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
616 #[doc = "Error state is unknown"]
617 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
618 #[doc = "SIM is required for the modem but missing"]
619 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
620 #[doc = "SIM is available, but not usable for connection"]
621 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
622}
623impl CellularNetworkFailedReason {
624 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
625}
626impl Default for CellularNetworkFailedReason {
627 fn default() -> Self {
628 Self::DEFAULT
629 }
630}
631#[cfg_attr(feature = "ts", derive(TS))]
632#[cfg_attr(feature = "ts", ts(export))]
633#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
634#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
635#[cfg_attr(feature = "serde", serde(tag = "type"))]
636#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
637#[repr(u32)]
638#[doc = "Cellular network radio type"]
639pub enum CellularNetworkRadioType {
640 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
641 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
642 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
643 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
644 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
645}
646impl CellularNetworkRadioType {
647 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
648}
649impl Default for CellularNetworkRadioType {
650 fn default() -> Self {
651 Self::DEFAULT
652 }
653}
654#[cfg_attr(feature = "ts", derive(TS))]
655#[cfg_attr(feature = "ts", ts(export))]
656#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
658#[cfg_attr(feature = "serde", serde(tag = "type"))]
659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
660#[repr(u32)]
661#[doc = "These flags encode the cellular network status"]
662pub enum CellularStatusFlag {
663 #[doc = "State unknown or not reportable."]
664 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
665 #[doc = "Modem is unusable"]
666 CELLULAR_STATUS_FLAG_FAILED = 1,
667 #[doc = "Modem is being initialized"]
668 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
669 #[doc = "Modem is locked"]
670 CELLULAR_STATUS_FLAG_LOCKED = 3,
671 #[doc = "Modem is not enabled and is powered down"]
672 CELLULAR_STATUS_FLAG_DISABLED = 4,
673 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
674 CELLULAR_STATUS_FLAG_DISABLING = 5,
675 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
676 CELLULAR_STATUS_FLAG_ENABLING = 6,
677 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
678 CELLULAR_STATUS_FLAG_ENABLED = 7,
679 #[doc = "Modem is searching for a network provider to register"]
680 CELLULAR_STATUS_FLAG_SEARCHING = 8,
681 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
682 CELLULAR_STATUS_FLAG_REGISTERED = 9,
683 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
684 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
685 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
686 CELLULAR_STATUS_FLAG_CONNECTING = 11,
687 #[doc = "One or more packet data bearers is active and connected"]
688 CELLULAR_STATUS_FLAG_CONNECTED = 12,
689}
690impl CellularStatusFlag {
691 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
692}
693impl Default for CellularStatusFlag {
694 fn default() -> Self {
695 Self::DEFAULT
696 }
697}
698#[cfg_attr(feature = "ts", derive(TS))]
699#[cfg_attr(feature = "ts", ts(export))]
700#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
702#[cfg_attr(feature = "serde", serde(tag = "type"))]
703#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
704#[repr(u32)]
705#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
706pub enum CompMetadataType {
707 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
708 COMP_METADATA_TYPE_GENERAL = 0,
709 #[doc = "Parameter meta data."]
710 COMP_METADATA_TYPE_PARAMETER = 1,
711 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
712 COMP_METADATA_TYPE_COMMANDS = 2,
713 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
714 COMP_METADATA_TYPE_PERIPHERALS = 3,
715 #[doc = "Meta data for the events interface."]
716 COMP_METADATA_TYPE_EVENTS = 4,
717 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
718 COMP_METADATA_TYPE_ACTUATORS = 5,
719}
720impl CompMetadataType {
721 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
722}
723impl Default for CompMetadataType {
724 fn default() -> Self {
725 Self::DEFAULT
726 }
727}
728#[cfg_attr(feature = "ts", derive(TS))]
729#[cfg_attr(feature = "ts", ts(export))]
730#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
732#[cfg_attr(feature = "serde", serde(tag = "type"))]
733#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
734#[repr(u32)]
735#[doc = "Indicates the ESC connection type."]
736pub enum EscConnectionType {
737 #[doc = "Traditional PPM ESC."]
738 ESC_CONNECTION_TYPE_PPM = 0,
739 #[doc = "Serial Bus connected ESC."]
740 ESC_CONNECTION_TYPE_SERIAL = 1,
741 #[doc = "One Shot PPM ESC."]
742 ESC_CONNECTION_TYPE_ONESHOT = 2,
743 #[doc = "I2C ESC."]
744 ESC_CONNECTION_TYPE_I2C = 3,
745 #[doc = "CAN-Bus ESC."]
746 ESC_CONNECTION_TYPE_CAN = 4,
747 #[doc = "DShot ESC."]
748 ESC_CONNECTION_TYPE_DSHOT = 5,
749}
750impl EscConnectionType {
751 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
752}
753impl Default for EscConnectionType {
754 fn default() -> Self {
755 Self::DEFAULT
756 }
757}
758bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
759impl EscFailureFlags {
760 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
761}
762impl Default for EscFailureFlags {
763 fn default() -> Self {
764 Self::DEFAULT
765 }
766}
767bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
768impl EstimatorStatusFlags {
769 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
770}
771impl Default for EstimatorStatusFlags {
772 fn default() -> Self {
773 Self::DEFAULT
774 }
775}
776#[cfg_attr(feature = "ts", derive(TS))]
777#[cfg_attr(feature = "ts", ts(export))]
778#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
779#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
780#[cfg_attr(feature = "serde", serde(tag = "type"))]
781#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
782#[repr(u32)]
783#[doc = "List of possible failure type to inject."]
784pub enum FailureType {
785 #[doc = "No failure injected, used to reset a previous failure."]
786 FAILURE_TYPE_OK = 0,
787 #[doc = "Sets unit off, so completely non-responsive."]
788 FAILURE_TYPE_OFF = 1,
789 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
790 FAILURE_TYPE_STUCK = 2,
791 #[doc = "Unit is reporting complete garbage."]
792 FAILURE_TYPE_GARBAGE = 3,
793 #[doc = "Unit is consistently wrong."]
794 FAILURE_TYPE_WRONG = 4,
795 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
796 FAILURE_TYPE_SLOW = 5,
797 #[doc = "Data of unit is delayed in time."]
798 FAILURE_TYPE_DELAYED = 6,
799 #[doc = "Unit is sometimes working, sometimes not."]
800 FAILURE_TYPE_INTERMITTENT = 7,
801}
802impl FailureType {
803 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
804}
805impl Default for FailureType {
806 fn default() -> Self {
807 Self::DEFAULT
808 }
809}
810#[cfg_attr(feature = "ts", derive(TS))]
811#[cfg_attr(feature = "ts", ts(export))]
812#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
813#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
814#[cfg_attr(feature = "serde", serde(tag = "type"))]
815#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
816#[repr(u32)]
817#[doc = "List of possible units where failures can be injected."]
818pub enum FailureUnit {
819 FAILURE_UNIT_SENSOR_GYRO = 0,
820 FAILURE_UNIT_SENSOR_ACCEL = 1,
821 FAILURE_UNIT_SENSOR_MAG = 2,
822 FAILURE_UNIT_SENSOR_BARO = 3,
823 FAILURE_UNIT_SENSOR_GPS = 4,
824 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
825 FAILURE_UNIT_SENSOR_VIO = 6,
826 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
827 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
828 FAILURE_UNIT_SYSTEM_BATTERY = 100,
829 FAILURE_UNIT_SYSTEM_MOTOR = 101,
830 FAILURE_UNIT_SYSTEM_SERVO = 102,
831 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
832 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
833 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
834}
835impl FailureUnit {
836 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
837}
838impl Default for FailureUnit {
839 fn default() -> Self {
840 Self::DEFAULT
841 }
842}
843#[cfg_attr(feature = "ts", derive(TS))]
844#[cfg_attr(feature = "ts", ts(export))]
845#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
847#[cfg_attr(feature = "serde", serde(tag = "type"))]
848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
849#[repr(u32)]
850pub enum FenceBreach {
851 #[doc = "No last fence breach"]
852 FENCE_BREACH_NONE = 0,
853 #[doc = "Breached minimum altitude"]
854 FENCE_BREACH_MINALT = 1,
855 #[doc = "Breached maximum altitude"]
856 FENCE_BREACH_MAXALT = 2,
857 #[doc = "Breached fence boundary"]
858 FENCE_BREACH_BOUNDARY = 3,
859}
860impl FenceBreach {
861 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
862}
863impl Default for FenceBreach {
864 fn default() -> Self {
865 Self::DEFAULT
866 }
867}
868#[cfg_attr(feature = "ts", derive(TS))]
869#[cfg_attr(feature = "ts", ts(export))]
870#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
871#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
872#[cfg_attr(feature = "serde", serde(tag = "type"))]
873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
874#[repr(u32)]
875#[doc = "Actions being taken to mitigate/prevent fence breach"]
876pub enum FenceMitigate {
877 #[doc = "Unknown"]
878 FENCE_MITIGATE_UNKNOWN = 0,
879 #[doc = "No actions being taken"]
880 FENCE_MITIGATE_NONE = 1,
881 #[doc = "Velocity limiting active to prevent breach"]
882 FENCE_MITIGATE_VEL_LIMIT = 2,
883}
884impl FenceMitigate {
885 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
886}
887impl Default for FenceMitigate {
888 fn default() -> Self {
889 Self::DEFAULT
890 }
891}
892#[cfg_attr(feature = "ts", derive(TS))]
893#[cfg_attr(feature = "ts", ts(export))]
894#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
895#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
896#[cfg_attr(feature = "serde", serde(tag = "type"))]
897#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
898#[repr(u32)]
899#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
900pub enum FenceType {
901 #[doc = "Maximum altitude fence"]
902 FENCE_TYPE_ALT_MAX = 1,
903 #[doc = "Circle fence"]
904 FENCE_TYPE_CIRCLE = 2,
905 #[doc = "Polygon fence"]
906 FENCE_TYPE_POLYGON = 4,
907 #[doc = "Minimum altitude fence"]
908 FENCE_TYPE_ALT_MIN = 8,
909}
910impl FenceType {
911 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
912}
913impl Default for FenceType {
914 fn default() -> Self {
915 Self::DEFAULT
916 }
917}
918#[cfg_attr(feature = "ts", derive(TS))]
919#[cfg_attr(feature = "ts", ts(export))]
920#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
922#[cfg_attr(feature = "serde", serde(tag = "type"))]
923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
924#[repr(u32)]
925#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
926pub enum FirmwareVersionType {
927 #[doc = "development release"]
928 FIRMWARE_VERSION_TYPE_DEV = 0,
929 #[doc = "alpha release"]
930 FIRMWARE_VERSION_TYPE_ALPHA = 64,
931 #[doc = "beta release"]
932 FIRMWARE_VERSION_TYPE_BETA = 128,
933 #[doc = "release candidate"]
934 FIRMWARE_VERSION_TYPE_RC = 192,
935 #[doc = "official stable release"]
936 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
937}
938impl FirmwareVersionType {
939 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
940}
941impl Default for FirmwareVersionType {
942 fn default() -> Self {
943 Self::DEFAULT
944 }
945}
946bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
947impl GimbalDeviceCapFlags {
948 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
949}
950impl Default for GimbalDeviceCapFlags {
951 fn default() -> Self {
952 Self::DEFAULT
953 }
954}
955bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
956impl GimbalDeviceErrorFlags {
957 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
958}
959impl Default for GimbalDeviceErrorFlags {
960 fn default() -> Self {
961 Self::DEFAULT
962 }
963}
964bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
965impl GimbalDeviceFlags {
966 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
967}
968impl Default for GimbalDeviceFlags {
969 fn default() -> Self {
970 Self::DEFAULT
971 }
972}
973bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
974impl GimbalManagerCapFlags {
975 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
976}
977impl Default for GimbalManagerCapFlags {
978 fn default() -> Self {
979 Self::DEFAULT
980 }
981}
982bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
983impl GimbalManagerFlags {
984 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
985}
986impl Default for GimbalManagerFlags {
987 fn default() -> Self {
988 Self::DEFAULT
989 }
990}
991#[cfg_attr(feature = "ts", derive(TS))]
992#[cfg_attr(feature = "ts", ts(export))]
993#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
994#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
995#[cfg_attr(feature = "serde", serde(tag = "type"))]
996#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
997#[repr(u32)]
998#[doc = "Type of GPS fix"]
999pub enum GpsFixType {
1000 #[doc = "No GPS connected"]
1001 GPS_FIX_TYPE_NO_GPS = 0,
1002 #[doc = "No position information, GPS is connected"]
1003 GPS_FIX_TYPE_NO_FIX = 1,
1004 #[doc = "2D position"]
1005 GPS_FIX_TYPE_2D_FIX = 2,
1006 #[doc = "3D position"]
1007 GPS_FIX_TYPE_3D_FIX = 3,
1008 #[doc = "DGPS/SBAS aided 3D position"]
1009 GPS_FIX_TYPE_DGPS = 4,
1010 #[doc = "RTK float, 3D position"]
1011 GPS_FIX_TYPE_RTK_FLOAT = 5,
1012 #[doc = "RTK Fixed, 3D position"]
1013 GPS_FIX_TYPE_RTK_FIXED = 6,
1014 #[doc = "Static fixed, typically used for base stations"]
1015 GPS_FIX_TYPE_STATIC = 7,
1016 #[doc = "PPP, 3D position."]
1017 GPS_FIX_TYPE_PPP = 8,
1018}
1019impl GpsFixType {
1020 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1021}
1022impl Default for GpsFixType {
1023 fn default() -> Self {
1024 Self::DEFAULT
1025 }
1026}
1027bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1028impl GpsInputIgnoreFlags {
1029 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1030}
1031impl Default for GpsInputIgnoreFlags {
1032 fn default() -> Self {
1033 Self::DEFAULT
1034 }
1035}
1036#[cfg_attr(feature = "ts", derive(TS))]
1037#[cfg_attr(feature = "ts", ts(export))]
1038#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1039#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1040#[cfg_attr(feature = "serde", serde(tag = "type"))]
1041#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1042#[repr(u32)]
1043#[doc = "Gripper actions."]
1044pub enum GripperActions {
1045 #[doc = "Gripper release cargo."]
1046 GRIPPER_ACTION_RELEASE = 0,
1047 #[doc = "Gripper grab onto cargo."]
1048 GRIPPER_ACTION_GRAB = 1,
1049}
1050impl GripperActions {
1051 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1052}
1053impl Default for GripperActions {
1054 fn default() -> Self {
1055 Self::DEFAULT
1056 }
1057}
1058#[cfg_attr(feature = "ts", derive(TS))]
1059#[cfg_attr(feature = "ts", ts(export))]
1060#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1062#[cfg_attr(feature = "serde", serde(tag = "type"))]
1063#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1064#[repr(u32)]
1065pub enum GsmLinkType {
1066 #[doc = "no service"]
1067 GSM_LINK_TYPE_NONE = 0,
1068 #[doc = "link type unknown"]
1069 GSM_LINK_TYPE_UNKNOWN = 1,
1070 #[doc = "2G (GSM/GRPS/EDGE) link"]
1071 GSM_LINK_TYPE_2G = 2,
1072 #[doc = "3G link (WCDMA/HSDPA/HSPA)"]
1073 GSM_LINK_TYPE_3G = 3,
1074 #[doc = "4G link (LTE)"]
1075 GSM_LINK_TYPE_4G = 4,
1076}
1077impl GsmLinkType {
1078 pub const DEFAULT: Self = Self::GSM_LINK_TYPE_NONE;
1079}
1080impl Default for GsmLinkType {
1081 fn default() -> Self {
1082 Self::DEFAULT
1083 }
1084}
1085#[cfg_attr(feature = "ts", derive(TS))]
1086#[cfg_attr(feature = "ts", ts(export))]
1087#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1088#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1089#[cfg_attr(feature = "serde", serde(tag = "type"))]
1090#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1091#[repr(u32)]
1092pub enum GsmModemType {
1093 #[doc = "not specified"]
1094 GSM_MODEM_TYPE_UNKNOWN = 0,
1095 #[doc = "HUAWEI LTE USB Stick E3372"]
1096 GSM_MODEM_TYPE_HUAWEI_E3372 = 1,
1097}
1098impl GsmModemType {
1099 pub const DEFAULT: Self = Self::GSM_MODEM_TYPE_UNKNOWN;
1100}
1101impl Default for GsmModemType {
1102 fn default() -> Self {
1103 Self::DEFAULT
1104 }
1105}
1106bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1107impl HighresImuUpdatedFlags {
1108 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1109}
1110impl Default for HighresImuUpdatedFlags {
1111 fn default() -> Self {
1112 Self::DEFAULT
1113 }
1114}
1115bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1116impl HilActuatorControlsFlags {
1117 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1118}
1119impl Default for HilActuatorControlsFlags {
1120 fn default() -> Self {
1121 Self::DEFAULT
1122 }
1123}
1124bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1125impl HilSensorUpdatedFlags {
1126 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1127}
1128impl Default for HilSensorUpdatedFlags {
1129 fn default() -> Self {
1130 Self::DEFAULT
1131 }
1132}
1133bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1134impl HlFailureFlag {
1135 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1136}
1137impl Default for HlFailureFlag {
1138 fn default() -> Self {
1139 Self::DEFAULT
1140 }
1141}
1142bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1143impl IlluminatorErrorFlags {
1144 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1145}
1146impl Default for IlluminatorErrorFlags {
1147 fn default() -> Self {
1148 Self::DEFAULT
1149 }
1150}
1151#[cfg_attr(feature = "ts", derive(TS))]
1152#[cfg_attr(feature = "ts", ts(export))]
1153#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1155#[cfg_attr(feature = "serde", serde(tag = "type"))]
1156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1157#[repr(u32)]
1158#[doc = "Modes of illuminator"]
1159pub enum IlluminatorMode {
1160 #[doc = "Illuminator mode is not specified/unknown"]
1161 ILLUMINATOR_MODE_UNKNOWN = 0,
1162 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1163 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1164 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1165 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1166}
1167impl IlluminatorMode {
1168 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1169}
1170impl Default for IlluminatorMode {
1171 fn default() -> Self {
1172 Self::DEFAULT
1173 }
1174}
1175#[cfg_attr(feature = "ts", derive(TS))]
1176#[cfg_attr(feature = "ts", ts(export))]
1177#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1178#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1179#[cfg_attr(feature = "serde", serde(tag = "type"))]
1180#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1181#[repr(u32)]
1182#[doc = "Type of landing target"]
1183pub enum LandingTargetType {
1184 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1185 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1186 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1187 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1188 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1189 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1190 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1191 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1192}
1193impl LandingTargetType {
1194 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1195}
1196impl Default for LandingTargetType {
1197 fn default() -> Self {
1198 Self::DEFAULT
1199 }
1200}
1201#[cfg_attr(feature = "ts", derive(TS))]
1202#[cfg_attr(feature = "ts", ts(export))]
1203#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1205#[cfg_attr(feature = "serde", serde(tag = "type"))]
1206#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1207#[repr(u32)]
1208pub enum MagCalStatus {
1209 MAG_CAL_NOT_STARTED = 0,
1210 MAG_CAL_WAITING_TO_START = 1,
1211 MAG_CAL_RUNNING_STEP_ONE = 2,
1212 MAG_CAL_RUNNING_STEP_TWO = 3,
1213 MAG_CAL_SUCCESS = 4,
1214 MAG_CAL_FAILED = 5,
1215 MAG_CAL_BAD_ORIENTATION = 6,
1216 MAG_CAL_BAD_RADIUS = 7,
1217}
1218impl MagCalStatus {
1219 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1220}
1221impl Default for MagCalStatus {
1222 fn default() -> Self {
1223 Self::DEFAULT
1224 }
1225}
1226#[cfg_attr(feature = "ts", derive(TS))]
1227#[cfg_attr(feature = "ts", ts(export))]
1228#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1229#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1230#[cfg_attr(feature = "serde", serde(tag = "type"))]
1231#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1232#[repr(u32)]
1233pub enum MavArmAuthDeniedReason {
1234 #[doc = "Not a specific reason"]
1235 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1236 #[doc = "Authorizer will send the error as string to GCS"]
1237 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1238 #[doc = "At least one waypoint have a invalid value"]
1239 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1240 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1241 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1242 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1243 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1244 #[doc = "Weather is not good to fly"]
1245 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1246}
1247impl MavArmAuthDeniedReason {
1248 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1249}
1250impl Default for MavArmAuthDeniedReason {
1251 fn default() -> Self {
1252 Self::DEFAULT
1253 }
1254}
1255#[cfg_attr(feature = "ts", derive(TS))]
1256#[cfg_attr(feature = "ts", ts(export))]
1257#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1258#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1259#[cfg_attr(feature = "serde", serde(tag = "type"))]
1260#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1261#[repr(u32)]
1262#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1263pub enum MavAutopilot {
1264 #[doc = "Generic autopilot, full support for everything"]
1265 MAV_AUTOPILOT_GENERIC = 0,
1266 #[doc = "Reserved for future use."]
1267 MAV_AUTOPILOT_RESERVED = 1,
1268 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1269 MAV_AUTOPILOT_SLUGS = 2,
1270 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1271 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1272 #[doc = "OpenPilot, <http://openpilot.org>"]
1273 MAV_AUTOPILOT_OPENPILOT = 4,
1274 #[doc = "Generic autopilot only supporting simple waypoints"]
1275 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1276 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1277 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1278 #[doc = "Generic autopilot supporting the full mission command set"]
1279 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1280 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1281 MAV_AUTOPILOT_INVALID = 8,
1282 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1283 MAV_AUTOPILOT_PPZ = 9,
1284 #[doc = "UAV Dev Board"]
1285 MAV_AUTOPILOT_UDB = 10,
1286 #[doc = "FlexiPilot"]
1287 MAV_AUTOPILOT_FP = 11,
1288 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1289 MAV_AUTOPILOT_PX4 = 12,
1290 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1291 MAV_AUTOPILOT_SMACCMPILOT = 13,
1292 #[doc = "AutoQuad -- <http://autoquad.org>"]
1293 MAV_AUTOPILOT_AUTOQUAD = 14,
1294 #[doc = "Armazila -- <http://armazila.com>"]
1295 MAV_AUTOPILOT_ARMAZILA = 15,
1296 #[doc = "Aerob -- <http://aerob.ru>"]
1297 MAV_AUTOPILOT_AEROB = 16,
1298 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1299 MAV_AUTOPILOT_ASLUAV = 17,
1300 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1301 MAV_AUTOPILOT_SMARTAP = 18,
1302 #[doc = "AirRails - <http://uaventure.com>"]
1303 MAV_AUTOPILOT_AIRRAILS = 19,
1304 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1305 MAV_AUTOPILOT_REFLEX = 20,
1306}
1307impl MavAutopilot {
1308 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1309}
1310impl Default for MavAutopilot {
1311 fn default() -> Self {
1312 Self::DEFAULT
1313 }
1314}
1315#[cfg_attr(feature = "ts", derive(TS))]
1316#[cfg_attr(feature = "ts", ts(export))]
1317#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1318#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1319#[cfg_attr(feature = "serde", serde(tag = "type"))]
1320#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1321#[repr(u32)]
1322#[doc = "Enumeration for battery charge states."]
1323pub enum MavBatteryChargeState {
1324 #[doc = "Low battery state is not provided"]
1325 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1326 #[doc = "Battery is not in low state. Normal operation."]
1327 MAV_BATTERY_CHARGE_STATE_OK = 1,
1328 #[doc = "Battery state is low, warn and monitor close."]
1329 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1330 #[doc = "Battery state is critical, return or abort immediately."]
1331 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1332 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1333 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1334 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1335 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1336 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1337 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1338 #[doc = "Battery is charging."]
1339 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1340}
1341impl MavBatteryChargeState {
1342 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1343}
1344impl Default for MavBatteryChargeState {
1345 fn default() -> Self {
1346 Self::DEFAULT
1347 }
1348}
1349bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1350impl MavBatteryFault {
1351 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1352}
1353impl Default for MavBatteryFault {
1354 fn default() -> Self {
1355 Self::DEFAULT
1356 }
1357}
1358#[cfg_attr(feature = "ts", derive(TS))]
1359#[cfg_attr(feature = "ts", ts(export))]
1360#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1361#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1362#[cfg_attr(feature = "serde", serde(tag = "type"))]
1363#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1364#[repr(u32)]
1365#[doc = "Enumeration of battery functions"]
1366pub enum MavBatteryFunction {
1367 #[doc = "Battery function is unknown"]
1368 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1369 #[doc = "Battery supports all flight systems"]
1370 MAV_BATTERY_FUNCTION_ALL = 1,
1371 #[doc = "Battery for the propulsion system"]
1372 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1373 #[doc = "Avionics battery"]
1374 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1375 #[doc = "Payload battery"]
1376 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1377}
1378impl MavBatteryFunction {
1379 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1380}
1381impl Default for MavBatteryFunction {
1382 fn default() -> Self {
1383 Self::DEFAULT
1384 }
1385}
1386#[cfg_attr(feature = "ts", derive(TS))]
1387#[cfg_attr(feature = "ts", ts(export))]
1388#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1389#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1390#[cfg_attr(feature = "serde", serde(tag = "type"))]
1391#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1392#[repr(u32)]
1393#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1394pub enum MavBatteryMode {
1395 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1396 MAV_BATTERY_MODE_UNKNOWN = 0,
1397 #[doc = "Battery is auto discharging (towards storage level)."]
1398 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1399 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1400 MAV_BATTERY_MODE_HOT_SWAP = 2,
1401}
1402impl MavBatteryMode {
1403 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1404}
1405impl Default for MavBatteryMode {
1406 fn default() -> Self {
1407 Self::DEFAULT
1408 }
1409}
1410#[cfg_attr(feature = "ts", derive(TS))]
1411#[cfg_attr(feature = "ts", ts(export))]
1412#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1413#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1414#[cfg_attr(feature = "serde", serde(tag = "type"))]
1415#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1416#[repr(u32)]
1417#[doc = "Enumeration of battery types"]
1418pub enum MavBatteryType {
1419 #[doc = "Not specified."]
1420 MAV_BATTERY_TYPE_UNKNOWN = 0,
1421 #[doc = "Lithium polymer battery"]
1422 MAV_BATTERY_TYPE_LIPO = 1,
1423 #[doc = "Lithium-iron-phosphate battery"]
1424 MAV_BATTERY_TYPE_LIFE = 2,
1425 #[doc = "Lithium-ION battery"]
1426 MAV_BATTERY_TYPE_LION = 3,
1427 #[doc = "Nickel metal hydride battery"]
1428 MAV_BATTERY_TYPE_NIMH = 4,
1429}
1430impl MavBatteryType {
1431 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1432}
1433impl Default for MavBatteryType {
1434 fn default() -> Self {
1435 Self::DEFAULT
1436 }
1437}
1438#[cfg_attr(feature = "ts", derive(TS))]
1439#[cfg_attr(feature = "ts", ts(export))]
1440#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1441#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1442#[cfg_attr(feature = "serde", serde(tag = "type"))]
1443#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1444#[repr(u32)]
1445#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1446pub enum MavCmd {
1447 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1448 MAV_CMD_NAV_WAYPOINT = 16,
1449 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1450 MAV_CMD_NAV_LOITER_UNLIM = 17,
1451 #[doc = "Loiter around this waypoint for X turns"]
1452 MAV_CMD_NAV_LOITER_TURNS = 18,
1453 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1454 MAV_CMD_NAV_LOITER_TIME = 19,
1455 #[doc = "Return to launch location"]
1456 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1457 #[doc = "Land at location."]
1458 MAV_CMD_NAV_LAND = 21,
1459 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1460 MAV_CMD_NAV_TAKEOFF = 22,
1461 #[doc = "Land at local position (local frame only)"]
1462 MAV_CMD_NAV_LAND_LOCAL = 23,
1463 #[doc = "Takeoff from local position (local frame only)"]
1464 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1465 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1466 MAV_CMD_NAV_FOLLOW = 25,
1467 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1468 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1469 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1470 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1471 #[doc = "Begin following a target"]
1472 MAV_CMD_DO_FOLLOW = 32,
1473 #[doc = "Reposition the MAV after a follow target command has been sent"]
1474 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1475 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1476 MAV_CMD_DO_ORBIT = 34,
1477 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1478 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1479 MAV_CMD_NAV_ROI = 80,
1480 #[doc = "Control autonomous path planning on the MAV."]
1481 MAV_CMD_NAV_PATHPLANNING = 81,
1482 #[doc = "Navigate to waypoint using a spline path."]
1483 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1484 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1485 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1486 #[doc = "Land using VTOL mode"]
1487 MAV_CMD_NAV_VTOL_LAND = 85,
1488 #[doc = "hand control over to an external controller"]
1489 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1490 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1491 MAV_CMD_NAV_DELAY = 93,
1492 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1493 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1494 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1495 MAV_CMD_NAV_LAST = 95,
1496 #[doc = "Delay mission state machine."]
1497 MAV_CMD_CONDITION_DELAY = 112,
1498 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1499 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1500 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1501 MAV_CMD_CONDITION_DISTANCE = 114,
1502 #[doc = "Reach a certain target angle."]
1503 MAV_CMD_CONDITION_YAW = 115,
1504 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1505 MAV_CMD_CONDITION_LAST = 159,
1506 #[doc = "Set system mode."]
1507 MAV_CMD_DO_SET_MODE = 176,
1508 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1509 MAV_CMD_DO_JUMP = 177,
1510 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1511 MAV_CMD_DO_CHANGE_SPEED = 178,
1512 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1513 MAV_CMD_DO_SET_HOME = 179,
1514 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1515 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1516 MAV_CMD_DO_SET_PARAMETER = 180,
1517 #[doc = "Set a relay to a condition."]
1518 MAV_CMD_DO_SET_RELAY = 181,
1519 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1520 MAV_CMD_DO_REPEAT_RELAY = 182,
1521 #[doc = "Set a servo to a desired PWM value."]
1522 MAV_CMD_DO_SET_SERVO = 183,
1523 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1524 MAV_CMD_DO_REPEAT_SERVO = 184,
1525 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1526 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1527 #[doc = "Change altitude set point."]
1528 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1529 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1530 MAV_CMD_DO_SET_ACTUATOR = 187,
1531 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1532 MAV_CMD_DO_RETURN_PATH_START = 188,
1533 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1534 MAV_CMD_DO_LAND_START = 189,
1535 #[doc = "Mission command to perform a landing from a rally point."]
1536 MAV_CMD_DO_RALLY_LAND = 190,
1537 #[doc = "Mission command to safely abort an autonomous landing."]
1538 MAV_CMD_DO_GO_AROUND = 191,
1539 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1540 MAV_CMD_DO_REPOSITION = 192,
1541 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1542 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1543 #[doc = "Set moving direction to forward or reverse."]
1544 MAV_CMD_DO_SET_REVERSE = 194,
1545 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1546 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1547 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1548 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1549 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1550 MAV_CMD_DO_SET_ROI_NONE = 197,
1551 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1552 MAV_CMD_DO_SET_ROI_SYSID = 198,
1553 #[doc = "Control onboard camera system."]
1554 MAV_CMD_DO_CONTROL_VIDEO = 200,
1555 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1556 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1557 MAV_CMD_DO_SET_ROI = 201,
1558 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1559 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1560 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1561 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1562 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1563 #[doc = "Mission command to configure a camera or antenna mount"]
1564 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1565 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1566 #[doc = "Mission command to control a camera or antenna mount"]
1567 MAV_CMD_DO_MOUNT_CONTROL = 205,
1568 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1569 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1570 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1571 MAV_CMD_DO_FENCE_ENABLE = 207,
1572 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1573 MAV_CMD_DO_PARACHUTE = 208,
1574 #[doc = "Command to perform motor test."]
1575 MAV_CMD_DO_MOTOR_TEST = 209,
1576 #[doc = "Change to/from inverted flight."]
1577 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1578 #[doc = "Mission command to operate a gripper."]
1579 MAV_CMD_DO_GRIPPER = 211,
1580 #[doc = "Enable/disable autotune."]
1581 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1582 #[doc = "Sets a desired vehicle turn angle and speed change."]
1583 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1584 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1585 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1586 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1587 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1588 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1589 #[doc = "set id of master controller"]
1590 MAV_CMD_DO_GUIDED_MASTER = 221,
1591 #[doc = "Set limits for external control"]
1592 MAV_CMD_DO_GUIDED_LIMITS = 222,
1593 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1594 MAV_CMD_DO_ENGINE_CONTROL = 223,
1595 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1596 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1597 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1598 MAV_CMD_DO_LAST = 240,
1599 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1600 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1601 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1602 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1603 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1604 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1605 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1606 MAV_CMD_PREFLIGHT_STORAGE = 245,
1607 #[doc = "Request the reboot or shutdown of system components."]
1608 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1609 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1610 MAV_CMD_OVERRIDE_GOTO = 252,
1611 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1612 MAV_CMD_OBLIQUE_SURVEY = 260,
1613 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1614 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1615 #[doc = "start running a mission"]
1616 MAV_CMD_MISSION_START = 300,
1617 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1618 MAV_CMD_ACTUATOR_TEST = 310,
1619 #[doc = "Actuator configuration command."]
1620 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1621 #[doc = "Arms / Disarms a component"]
1622 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1623 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1624 MAV_CMD_RUN_PREARM_CHECKS = 401,
1625 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1626 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1627 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1628 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1629 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1630 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1631 MAV_CMD_GET_HOME_POSITION = 410,
1632 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1633 MAV_CMD_INJECT_FAILURE = 420,
1634 #[doc = "Starts receiver pairing."]
1635 MAV_CMD_START_RX_PAIR = 500,
1636 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1637 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1638 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1639 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1640 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1641 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1642 MAV_CMD_REQUEST_MESSAGE = 512,
1643 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1644 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1645 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1646 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1647 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1648 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1649 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1650 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1651 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1652 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1653 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1654 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1655 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1656 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1657 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1658 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1659 MAV_CMD_STORAGE_FORMAT = 526,
1660 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1661 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1662 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1663 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1664 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1665 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1666 #[doc = "Reset all camera settings to Factory Default"]
1667 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1668 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1669 MAV_CMD_SET_CAMERA_MODE = 530,
1670 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1671 MAV_CMD_SET_CAMERA_ZOOM = 531,
1672 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1673 MAV_CMD_SET_CAMERA_FOCUS = 532,
1674 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1675 MAV_CMD_SET_STORAGE_USAGE = 533,
1676 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1677 MAV_CMD_SET_CAMERA_SOURCE = 534,
1678 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1679 MAV_CMD_JUMP_TAG = 600,
1680 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1681 MAV_CMD_DO_JUMP_TAG = 601,
1682 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1683 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1684 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1685 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1686 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1687 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1688 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1689 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1690 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1691 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1692 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1693 #[doc = "Enable or disable on-board camera triggering system."]
1694 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1695 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1696 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1697 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1698 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1699 #[doc = "Stops ongoing tracking."]
1700 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1701 #[doc = "Starts video capture (recording)."]
1702 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1703 #[doc = "Stop the current video capture (recording)."]
1704 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1705 #[doc = "Start video streaming"]
1706 MAV_CMD_VIDEO_START_STREAMING = 2502,
1707 #[doc = "Stop the given video stream"]
1708 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1709 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1710 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1711 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1712 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1713 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1714 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1715 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1716 MAV_CMD_LOGGING_START = 2510,
1717 #[doc = "Request to stop streaming log data over MAVLink"]
1718 MAV_CMD_LOGGING_STOP = 2511,
1719 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1720 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1721 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1722 #[doc = "Create a panorama at the current position"]
1723 MAV_CMD_PANORAMA_CREATE = 2800,
1724 #[doc = "Request VTOL transition"]
1725 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1726 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1727 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1728 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1729 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1730 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1731 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1732 #[doc = "Delay mission state machine until gate has been reached."]
1733 MAV_CMD_CONDITION_GATE = 4501,
1734 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1735 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1736 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1737 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1738 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1739 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1740 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1741 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1742 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1743 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1744 #[doc = "Rally point. You can have multiple rally points defined."]
1745 MAV_CMD_NAV_RALLY_POINT = 5100,
1746 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1747 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1748 #[doc = "Change state of safety switch."]
1749 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1750 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1751 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1752 #[deprecated = " (Deprecated since 2021-06)"]
1753 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1754 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1755 #[deprecated = " (Deprecated since 2021-06)"]
1756 #[doc = "Control the payload deployment."]
1757 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1758 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1759 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1760 #[doc = "Command to operate winch."]
1761 MAV_CMD_DO_WINCH = 42600,
1762 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1763 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1764 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1765 MAV_CMD_WAYPOINT_USER_1 = 31000,
1766 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1767 MAV_CMD_WAYPOINT_USER_2 = 31001,
1768 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1769 MAV_CMD_WAYPOINT_USER_3 = 31002,
1770 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1771 MAV_CMD_WAYPOINT_USER_4 = 31003,
1772 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1773 MAV_CMD_WAYPOINT_USER_5 = 31004,
1774 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1775 MAV_CMD_SPATIAL_USER_1 = 31005,
1776 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1777 MAV_CMD_SPATIAL_USER_2 = 31006,
1778 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1779 MAV_CMD_SPATIAL_USER_3 = 31007,
1780 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1781 MAV_CMD_SPATIAL_USER_4 = 31008,
1782 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1783 MAV_CMD_SPATIAL_USER_5 = 31009,
1784 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1785 MAV_CMD_USER_1 = 31010,
1786 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1787 MAV_CMD_USER_2 = 31011,
1788 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1789 MAV_CMD_USER_3 = 31012,
1790 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1791 MAV_CMD_USER_4 = 31013,
1792 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1793 MAV_CMD_USER_5 = 31014,
1794 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1795 MAV_CMD_CAN_FORWARD = 32000,
1796 #[doc = "Mission command to reset Maximum Power Point Tracker (MPPT)"]
1797 MAV_CMD_RESET_MPPT = 40001,
1798 #[doc = "Mission command to perform a power cycle on payload"]
1799 MAV_CMD_PAYLOAD_CONTROL = 40002,
1800}
1801impl MavCmd {
1802 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1803}
1804impl Default for MavCmd {
1805 fn default() -> Self {
1806 Self::DEFAULT
1807 }
1808}
1809#[cfg_attr(feature = "ts", derive(TS))]
1810#[cfg_attr(feature = "ts", ts(export))]
1811#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1812#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1813#[cfg_attr(feature = "serde", serde(tag = "type"))]
1814#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1815#[repr(u32)]
1816#[doc = "Possible actions an aircraft can take to avoid a collision."]
1817pub enum MavCollisionAction {
1818 #[doc = "Ignore any potential collisions"]
1819 MAV_COLLISION_ACTION_NONE = 0,
1820 #[doc = "Report potential collision"]
1821 MAV_COLLISION_ACTION_REPORT = 1,
1822 #[doc = "Ascend or Descend to avoid threat"]
1823 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1824 #[doc = "Move horizontally to avoid threat"]
1825 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1826 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1827 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1828 #[doc = "Aircraft to fly directly back to its launch point"]
1829 MAV_COLLISION_ACTION_RTL = 5,
1830 #[doc = "Aircraft to stop in place"]
1831 MAV_COLLISION_ACTION_HOVER = 6,
1832}
1833impl MavCollisionAction {
1834 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1835}
1836impl Default for MavCollisionAction {
1837 fn default() -> Self {
1838 Self::DEFAULT
1839 }
1840}
1841#[cfg_attr(feature = "ts", derive(TS))]
1842#[cfg_attr(feature = "ts", ts(export))]
1843#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1845#[cfg_attr(feature = "serde", serde(tag = "type"))]
1846#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1847#[repr(u32)]
1848#[doc = "Source of information about this collision."]
1849pub enum MavCollisionSrc {
1850 #[doc = "ID field references ADSB_VEHICLE packets"]
1851 MAV_COLLISION_SRC_ADSB = 0,
1852 #[doc = "ID field references MAVLink SRC ID"]
1853 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1854}
1855impl MavCollisionSrc {
1856 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1857}
1858impl Default for MavCollisionSrc {
1859 fn default() -> Self {
1860 Self::DEFAULT
1861 }
1862}
1863#[cfg_attr(feature = "ts", derive(TS))]
1864#[cfg_attr(feature = "ts", ts(export))]
1865#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1867#[cfg_attr(feature = "serde", serde(tag = "type"))]
1868#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1869#[repr(u32)]
1870#[doc = "Aircraft-rated danger from this threat."]
1871pub enum MavCollisionThreatLevel {
1872 #[doc = "Not a threat"]
1873 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1874 #[doc = "Craft is mildly concerned about this threat"]
1875 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1876 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1877 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1878}
1879impl MavCollisionThreatLevel {
1880 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1881}
1882impl Default for MavCollisionThreatLevel {
1883 fn default() -> Self {
1884 Self::DEFAULT
1885 }
1886}
1887#[cfg_attr(feature = "ts", derive(TS))]
1888#[cfg_attr(feature = "ts", ts(export))]
1889#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1890#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1891#[cfg_attr(feature = "serde", serde(tag = "type"))]
1892#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1893#[repr(u32)]
1894#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1895pub enum MavComponent {
1896 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1897 MAV_COMP_ID_ALL = 0,
1898 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1899 MAV_COMP_ID_AUTOPILOT1 = 1,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER1 = 25,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER2 = 26,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER3 = 27,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER4 = 28,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER5 = 29,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER6 = 30,
1912 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1913 MAV_COMP_ID_USER7 = 31,
1914 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1915 MAV_COMP_ID_USER8 = 32,
1916 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1917 MAV_COMP_ID_USER9 = 33,
1918 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1919 MAV_COMP_ID_USER10 = 34,
1920 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1921 MAV_COMP_ID_USER11 = 35,
1922 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1923 MAV_COMP_ID_USER12 = 36,
1924 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1925 MAV_COMP_ID_USER13 = 37,
1926 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1927 MAV_COMP_ID_USER14 = 38,
1928 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1929 MAV_COMP_ID_USER15 = 39,
1930 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1931 MAV_COMP_ID_USER16 = 40,
1932 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1933 MAV_COMP_ID_USER17 = 41,
1934 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1935 MAV_COMP_ID_USER18 = 42,
1936 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1937 MAV_COMP_ID_USER19 = 43,
1938 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1939 MAV_COMP_ID_USER20 = 44,
1940 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1941 MAV_COMP_ID_USER21 = 45,
1942 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1943 MAV_COMP_ID_USER22 = 46,
1944 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1945 MAV_COMP_ID_USER23 = 47,
1946 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1947 MAV_COMP_ID_USER24 = 48,
1948 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1949 MAV_COMP_ID_USER25 = 49,
1950 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1951 MAV_COMP_ID_USER26 = 50,
1952 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1953 MAV_COMP_ID_USER27 = 51,
1954 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1955 MAV_COMP_ID_USER28 = 52,
1956 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1957 MAV_COMP_ID_USER29 = 53,
1958 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1959 MAV_COMP_ID_USER30 = 54,
1960 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1961 MAV_COMP_ID_USER31 = 55,
1962 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1963 MAV_COMP_ID_USER32 = 56,
1964 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1965 MAV_COMP_ID_USER33 = 57,
1966 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1967 MAV_COMP_ID_USER34 = 58,
1968 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1969 MAV_COMP_ID_USER35 = 59,
1970 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1971 MAV_COMP_ID_USER36 = 60,
1972 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1973 MAV_COMP_ID_USER37 = 61,
1974 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1975 MAV_COMP_ID_USER38 = 62,
1976 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1977 MAV_COMP_ID_USER39 = 63,
1978 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1979 MAV_COMP_ID_USER40 = 64,
1980 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1981 MAV_COMP_ID_USER41 = 65,
1982 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1983 MAV_COMP_ID_USER42 = 66,
1984 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1985 MAV_COMP_ID_USER43 = 67,
1986 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1987 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1988 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1989 MAV_COMP_ID_USER45 = 69,
1990 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1991 MAV_COMP_ID_USER46 = 70,
1992 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1993 MAV_COMP_ID_USER47 = 71,
1994 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1995 MAV_COMP_ID_USER48 = 72,
1996 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1997 MAV_COMP_ID_USER49 = 73,
1998 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1999 MAV_COMP_ID_USER50 = 74,
2000 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2001 MAV_COMP_ID_USER51 = 75,
2002 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2003 MAV_COMP_ID_USER52 = 76,
2004 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2005 MAV_COMP_ID_USER53 = 77,
2006 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2007 MAV_COMP_ID_USER54 = 78,
2008 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2009 MAV_COMP_ID_USER55 = 79,
2010 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2011 MAV_COMP_ID_USER56 = 80,
2012 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2013 MAV_COMP_ID_USER57 = 81,
2014 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2015 MAV_COMP_ID_USER58 = 82,
2016 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2017 MAV_COMP_ID_USER59 = 83,
2018 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2019 MAV_COMP_ID_USER60 = 84,
2020 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2021 MAV_COMP_ID_USER61 = 85,
2022 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2023 MAV_COMP_ID_USER62 = 86,
2024 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2025 MAV_COMP_ID_USER63 = 87,
2026 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2027 MAV_COMP_ID_USER64 = 88,
2028 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2029 MAV_COMP_ID_USER65 = 89,
2030 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2031 MAV_COMP_ID_USER66 = 90,
2032 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2033 MAV_COMP_ID_USER67 = 91,
2034 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2035 MAV_COMP_ID_USER68 = 92,
2036 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2037 MAV_COMP_ID_USER69 = 93,
2038 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2039 MAV_COMP_ID_USER70 = 94,
2040 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2041 MAV_COMP_ID_USER71 = 95,
2042 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2043 MAV_COMP_ID_USER72 = 96,
2044 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2045 MAV_COMP_ID_USER73 = 97,
2046 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2047 MAV_COMP_ID_USER74 = 98,
2048 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2049 MAV_COMP_ID_USER75 = 99,
2050 #[doc = "Camera #1."]
2051 MAV_COMP_ID_CAMERA = 100,
2052 #[doc = "Camera #2."]
2053 MAV_COMP_ID_CAMERA2 = 101,
2054 #[doc = "Camera #3."]
2055 MAV_COMP_ID_CAMERA3 = 102,
2056 #[doc = "Camera #4."]
2057 MAV_COMP_ID_CAMERA4 = 103,
2058 #[doc = "Camera #5."]
2059 MAV_COMP_ID_CAMERA5 = 104,
2060 #[doc = "Camera #6."]
2061 MAV_COMP_ID_CAMERA6 = 105,
2062 #[doc = "Servo #1."]
2063 MAV_COMP_ID_SERVO1 = 140,
2064 #[doc = "Servo #2."]
2065 MAV_COMP_ID_SERVO2 = 141,
2066 #[doc = "Servo #3."]
2067 MAV_COMP_ID_SERVO3 = 142,
2068 #[doc = "Servo #4."]
2069 MAV_COMP_ID_SERVO4 = 143,
2070 #[doc = "Servo #5."]
2071 MAV_COMP_ID_SERVO5 = 144,
2072 #[doc = "Servo #6."]
2073 MAV_COMP_ID_SERVO6 = 145,
2074 #[doc = "Servo #7."]
2075 MAV_COMP_ID_SERVO7 = 146,
2076 #[doc = "Servo #8."]
2077 MAV_COMP_ID_SERVO8 = 147,
2078 #[doc = "Servo #9."]
2079 MAV_COMP_ID_SERVO9 = 148,
2080 #[doc = "Servo #10."]
2081 MAV_COMP_ID_SERVO10 = 149,
2082 #[doc = "Servo #11."]
2083 MAV_COMP_ID_SERVO11 = 150,
2084 #[doc = "Servo #12."]
2085 MAV_COMP_ID_SERVO12 = 151,
2086 #[doc = "Servo #13."]
2087 MAV_COMP_ID_SERVO13 = 152,
2088 #[doc = "Servo #14."]
2089 MAV_COMP_ID_SERVO14 = 153,
2090 #[doc = "Gimbal #1."]
2091 MAV_COMP_ID_GIMBAL = 154,
2092 #[doc = "Logging component."]
2093 MAV_COMP_ID_LOG = 155,
2094 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2095 MAV_COMP_ID_ADSB = 156,
2096 #[doc = "On Screen Display (OSD) devices for video links."]
2097 MAV_COMP_ID_OSD = 157,
2098 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2099 MAV_COMP_ID_PERIPHERAL = 158,
2100 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2101 #[doc = "Gimbal ID for QX1."]
2102 MAV_COMP_ID_QX1_GIMBAL = 159,
2103 #[doc = "FLARM collision alert component."]
2104 MAV_COMP_ID_FLARM = 160,
2105 #[doc = "Parachute component."]
2106 MAV_COMP_ID_PARACHUTE = 161,
2107 #[doc = "Winch component."]
2108 MAV_COMP_ID_WINCH = 169,
2109 #[doc = "Gimbal #2."]
2110 MAV_COMP_ID_GIMBAL2 = 171,
2111 #[doc = "Gimbal #3."]
2112 MAV_COMP_ID_GIMBAL3 = 172,
2113 #[doc = "Gimbal #4"]
2114 MAV_COMP_ID_GIMBAL4 = 173,
2115 #[doc = "Gimbal #5."]
2116 MAV_COMP_ID_GIMBAL5 = 174,
2117 #[doc = "Gimbal #6."]
2118 MAV_COMP_ID_GIMBAL6 = 175,
2119 #[doc = "Battery #1."]
2120 MAV_COMP_ID_BATTERY = 180,
2121 #[doc = "Battery #2."]
2122 MAV_COMP_ID_BATTERY2 = 181,
2123 #[doc = "CAN over MAVLink client."]
2124 MAV_COMP_ID_MAVCAN = 189,
2125 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2126 MAV_COMP_ID_MISSIONPLANNER = 190,
2127 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2128 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2129 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2130 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2131 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2132 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2133 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2134 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2135 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2136 MAV_COMP_ID_PATHPLANNER = 195,
2137 #[doc = "Component that plans a collision free path between two points."]
2138 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2139 #[doc = "Component that provides position estimates using VIO techniques."]
2140 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2141 #[doc = "Component that manages pairing of vehicle and GCS."]
2142 MAV_COMP_ID_PAIRING_MANAGER = 198,
2143 #[doc = "Inertial Measurement Unit (IMU) #1."]
2144 MAV_COMP_ID_IMU = 200,
2145 #[doc = "Inertial Measurement Unit (IMU) #2."]
2146 MAV_COMP_ID_IMU_2 = 201,
2147 #[doc = "Inertial Measurement Unit (IMU) #3."]
2148 MAV_COMP_ID_IMU_3 = 202,
2149 #[doc = "GPS #1."]
2150 MAV_COMP_ID_GPS = 220,
2151 #[doc = "GPS #2."]
2152 MAV_COMP_ID_GPS2 = 221,
2153 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2154 MAV_COMP_ID_ODID_TXRX_1 = 236,
2155 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2156 MAV_COMP_ID_ODID_TXRX_2 = 237,
2157 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2158 MAV_COMP_ID_ODID_TXRX_3 = 238,
2159 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2160 MAV_COMP_ID_UDP_BRIDGE = 240,
2161 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2162 MAV_COMP_ID_UART_BRIDGE = 241,
2163 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2164 MAV_COMP_ID_TUNNEL_NODE = 242,
2165 #[doc = "Illuminator"]
2166 MAV_COMP_ID_ILLUMINATOR = 243,
2167 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2168 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2169 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2170}
2171impl MavComponent {
2172 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2173}
2174impl Default for MavComponent {
2175 fn default() -> Self {
2176 Self::DEFAULT
2177 }
2178}
2179#[cfg_attr(feature = "ts", derive(TS))]
2180#[cfg_attr(feature = "ts", ts(export))]
2181#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2183#[cfg_attr(feature = "serde", serde(tag = "type"))]
2184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2185#[repr(u32)]
2186#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2187#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2188pub enum MavDataStream {
2189 #[doc = "Enable all data streams"]
2190 MAV_DATA_STREAM_ALL = 0,
2191 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2192 MAV_DATA_STREAM_RAW_SENSORS = 1,
2193 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2194 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2195 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2196 MAV_DATA_STREAM_RC_CHANNELS = 3,
2197 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2198 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2199 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2200 MAV_DATA_STREAM_POSITION = 6,
2201 #[doc = "Dependent on the autopilot"]
2202 MAV_DATA_STREAM_EXTRA1 = 10,
2203 #[doc = "Dependent on the autopilot"]
2204 MAV_DATA_STREAM_EXTRA2 = 11,
2205 #[doc = "Dependent on the autopilot"]
2206 MAV_DATA_STREAM_EXTRA3 = 12,
2207}
2208impl MavDataStream {
2209 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2210}
2211impl Default for MavDataStream {
2212 fn default() -> Self {
2213 Self::DEFAULT
2214 }
2215}
2216#[cfg_attr(feature = "ts", derive(TS))]
2217#[cfg_attr(feature = "ts", ts(export))]
2218#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2219#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2220#[cfg_attr(feature = "serde", serde(tag = "type"))]
2221#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2222#[repr(u32)]
2223#[doc = "Enumeration of distance sensor types"]
2224pub enum MavDistanceSensor {
2225 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2226 MAV_DISTANCE_SENSOR_LASER = 0,
2227 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2228 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2229 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2230 MAV_DISTANCE_SENSOR_INFRARED = 2,
2231 #[doc = "Radar type, e.g. uLanding units"]
2232 MAV_DISTANCE_SENSOR_RADAR = 3,
2233 #[doc = "Broken or unknown type, e.g. analog units"]
2234 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2235}
2236impl MavDistanceSensor {
2237 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2238}
2239impl Default for MavDistanceSensor {
2240 fn default() -> Self {
2241 Self::DEFAULT
2242 }
2243}
2244#[cfg_attr(feature = "ts", derive(TS))]
2245#[cfg_attr(feature = "ts", ts(export))]
2246#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2247#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2248#[cfg_attr(feature = "serde", serde(tag = "type"))]
2249#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2250#[repr(u32)]
2251#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2252pub enum MavDoRepositionFlags {
2253 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2254 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2255}
2256impl MavDoRepositionFlags {
2257 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2258}
2259impl Default for MavDoRepositionFlags {
2260 fn default() -> Self {
2261 Self::DEFAULT
2262 }
2263}
2264#[cfg_attr(feature = "ts", derive(TS))]
2265#[cfg_attr(feature = "ts", ts(export))]
2266#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2267#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2268#[cfg_attr(feature = "serde", serde(tag = "type"))]
2269#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2270#[repr(u32)]
2271#[doc = "Enumeration of estimator types"]
2272pub enum MavEstimatorType {
2273 #[doc = "Unknown type of the estimator."]
2274 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2275 #[doc = "This is a naive estimator without any real covariance feedback."]
2276 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2277 #[doc = "Computer vision based estimate. Might be up to scale."]
2278 MAV_ESTIMATOR_TYPE_VISION = 2,
2279 #[doc = "Visual-inertial estimate."]
2280 MAV_ESTIMATOR_TYPE_VIO = 3,
2281 #[doc = "Plain GPS estimate."]
2282 MAV_ESTIMATOR_TYPE_GPS = 4,
2283 #[doc = "Estimator integrating GPS and inertial sensing."]
2284 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2285 #[doc = "Estimate from external motion capturing system."]
2286 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2287 #[doc = "Estimator based on lidar sensor input."]
2288 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2289 #[doc = "Estimator on autopilot."]
2290 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2291}
2292impl MavEstimatorType {
2293 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2294}
2295impl Default for MavEstimatorType {
2296 fn default() -> Self {
2297 Self::DEFAULT
2298 }
2299}
2300#[cfg_attr(feature = "ts", derive(TS))]
2301#[cfg_attr(feature = "ts", ts(export))]
2302#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2304#[cfg_attr(feature = "serde", serde(tag = "type"))]
2305#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2306#[repr(u32)]
2307#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2308pub enum MavEventCurrentSequenceFlags {
2309 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2310 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2311}
2312impl MavEventCurrentSequenceFlags {
2313 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2314}
2315impl Default for MavEventCurrentSequenceFlags {
2316 fn default() -> Self {
2317 Self::DEFAULT
2318 }
2319}
2320#[cfg_attr(feature = "ts", derive(TS))]
2321#[cfg_attr(feature = "ts", ts(export))]
2322#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2323#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2324#[cfg_attr(feature = "serde", serde(tag = "type"))]
2325#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2326#[repr(u32)]
2327#[doc = "Reason for an event error response."]
2328pub enum MavEventErrorReason {
2329 #[doc = "The requested event is not available (anymore)."]
2330 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2331}
2332impl MavEventErrorReason {
2333 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2334}
2335impl Default for MavEventErrorReason {
2336 fn default() -> Self {
2337 Self::DEFAULT
2338 }
2339}
2340#[cfg_attr(feature = "ts", derive(TS))]
2341#[cfg_attr(feature = "ts", ts(export))]
2342#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2343#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2344#[cfg_attr(feature = "serde", serde(tag = "type"))]
2345#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2346#[repr(u32)]
2347#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2348pub enum MavFrame {
2349 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2350 MAV_FRAME_GLOBAL = 0,
2351 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2352 MAV_FRAME_LOCAL_NED = 1,
2353 #[doc = "NOT a coordinate frame, indicates a mission command."]
2354 MAV_FRAME_MISSION = 2,
2355 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2356 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2357 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2358 MAV_FRAME_LOCAL_ENU = 4,
2359 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2360 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2361 MAV_FRAME_GLOBAL_INT = 5,
2362 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2363 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2364 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2365 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2366 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2367 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2368 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2369 MAV_FRAME_BODY_NED = 8,
2370 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2371 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2372 MAV_FRAME_BODY_OFFSET_NED = 9,
2373 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2374 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2375 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2376 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2377 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2378 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2379 MAV_FRAME_BODY_FRD = 12,
2380 #[deprecated = " (Deprecated since 2019-04)"]
2381 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2382 MAV_FRAME_RESERVED_13 = 13,
2383 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2384 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2385 MAV_FRAME_RESERVED_14 = 14,
2386 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2387 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2388 MAV_FRAME_RESERVED_15 = 15,
2389 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2390 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2391 MAV_FRAME_RESERVED_16 = 16,
2392 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2393 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2394 MAV_FRAME_RESERVED_17 = 17,
2395 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2396 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2397 MAV_FRAME_RESERVED_18 = 18,
2398 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2399 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2400 MAV_FRAME_RESERVED_19 = 19,
2401 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2402 MAV_FRAME_LOCAL_FRD = 20,
2403 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2404 MAV_FRAME_LOCAL_FLU = 21,
2405}
2406impl MavFrame {
2407 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2408}
2409impl Default for MavFrame {
2410 fn default() -> Self {
2411 Self::DEFAULT
2412 }
2413}
2414#[cfg_attr(feature = "ts", derive(TS))]
2415#[cfg_attr(feature = "ts", ts(export))]
2416#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2417#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2418#[cfg_attr(feature = "serde", serde(tag = "type"))]
2419#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2420#[repr(u32)]
2421#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2422pub enum MavFtpErr {
2423 #[doc = "None: No error"]
2424 MAV_FTP_ERR_NONE = 0,
2425 #[doc = "Fail: Unknown failure"]
2426 MAV_FTP_ERR_FAIL = 1,
2427 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2428 MAV_FTP_ERR_FAILERRNO = 2,
2429 #[doc = "InvalidDataSize: Payload size is invalid"]
2430 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2431 #[doc = "InvalidSession: Session is not currently open"]
2432 MAV_FTP_ERR_INVALIDSESSION = 4,
2433 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2434 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2435 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2436 MAV_FTP_ERR_EOF = 6,
2437 #[doc = "UnknownCommand: Unknown command / opcode"]
2438 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2439 #[doc = "FileExists: File/directory already exists"]
2440 MAV_FTP_ERR_FILEEXISTS = 8,
2441 #[doc = "FileProtected: File/directory is write protected"]
2442 MAV_FTP_ERR_FILEPROTECTED = 9,
2443 #[doc = "FileNotFound: File/directory not found"]
2444 MAV_FTP_ERR_FILENOTFOUND = 10,
2445}
2446impl MavFtpErr {
2447 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2448}
2449impl Default for MavFtpErr {
2450 fn default() -> Self {
2451 Self::DEFAULT
2452 }
2453}
2454#[cfg_attr(feature = "ts", derive(TS))]
2455#[cfg_attr(feature = "ts", ts(export))]
2456#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2458#[cfg_attr(feature = "serde", serde(tag = "type"))]
2459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2460#[repr(u32)]
2461#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2462pub enum MavFtpOpcode {
2463 #[doc = "None. Ignored, always ACKed"]
2464 MAV_FTP_OPCODE_NONE = 0,
2465 #[doc = "TerminateSession: Terminates open Read session"]
2466 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2467 #[doc = "ResetSessions: Terminates all open read sessions"]
2468 MAV_FTP_OPCODE_RESETSESSION = 2,
2469 #[doc = "ListDirectory. List files and directories in path from offset"]
2470 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2471 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2472 MAV_FTP_OPCODE_OPENFILERO = 4,
2473 #[doc = "ReadFile: Reads size bytes from offset in session"]
2474 MAV_FTP_OPCODE_READFILE = 5,
2475 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2476 MAV_FTP_OPCODE_CREATEFILE = 6,
2477 #[doc = "WriteFile: Writes size bytes to offset in session"]
2478 MAV_FTP_OPCODE_WRITEFILE = 7,
2479 #[doc = "RemoveFile: Remove file at path"]
2480 MAV_FTP_OPCODE_REMOVEFILE = 8,
2481 #[doc = "CreateDirectory: Creates directory at path"]
2482 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2483 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2484 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2485 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2486 MAV_FTP_OPCODE_OPENFILEWO = 11,
2487 #[doc = "TruncateFile: Truncate file at path to offset length"]
2488 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2489 #[doc = "Rename: Rename path1 to path2"]
2490 MAV_FTP_OPCODE_RENAME = 13,
2491 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2492 MAV_FTP_OPCODE_CALCFILECRC = 14,
2493 #[doc = "BurstReadFile: Burst download session file"]
2494 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2495 #[doc = "ACK: ACK response"]
2496 MAV_FTP_OPCODE_ACK = 128,
2497 #[doc = "NAK: NAK response"]
2498 MAV_FTP_OPCODE_NAK = 129,
2499}
2500impl MavFtpOpcode {
2501 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2502}
2503impl Default for MavFtpOpcode {
2504 fn default() -> Self {
2505 Self::DEFAULT
2506 }
2507}
2508#[cfg_attr(feature = "ts", derive(TS))]
2509#[cfg_attr(feature = "ts", ts(export))]
2510#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2511#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2512#[cfg_attr(feature = "serde", serde(tag = "type"))]
2513#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2514#[repr(u32)]
2515#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2516pub enum MavFuelType {
2517 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2518 MAV_FUEL_TYPE_UNKNOWN = 0,
2519 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2520 MAV_FUEL_TYPE_LIQUID = 1,
2521 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2522 MAV_FUEL_TYPE_GAS = 2,
2523}
2524impl MavFuelType {
2525 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2526}
2527impl Default for MavFuelType {
2528 fn default() -> Self {
2529 Self::DEFAULT
2530 }
2531}
2532bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2533impl MavGeneratorStatusFlag {
2534 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2535}
2536impl Default for MavGeneratorStatusFlag {
2537 fn default() -> Self {
2538 Self::DEFAULT
2539 }
2540}
2541#[cfg_attr(feature = "ts", derive(TS))]
2542#[cfg_attr(feature = "ts", ts(export))]
2543#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2545#[cfg_attr(feature = "serde", serde(tag = "type"))]
2546#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2547#[repr(u32)]
2548#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2549pub enum MavGoto {
2550 #[doc = "Hold at the current position."]
2551 MAV_GOTO_DO_HOLD = 0,
2552 #[doc = "Continue with the next item in mission execution."]
2553 MAV_GOTO_DO_CONTINUE = 1,
2554 #[doc = "Hold at the current position of the system"]
2555 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2556 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2557 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2558}
2559impl MavGoto {
2560 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2561}
2562impl Default for MavGoto {
2563 fn default() -> Self {
2564 Self::DEFAULT
2565 }
2566}
2567#[cfg_attr(feature = "ts", derive(TS))]
2568#[cfg_attr(feature = "ts", ts(export))]
2569#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2570#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2571#[cfg_attr(feature = "serde", serde(tag = "type"))]
2572#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2573#[repr(u32)]
2574#[doc = "Enumeration of landed detector states"]
2575pub enum MavLandedState {
2576 #[doc = "MAV landed state is unknown"]
2577 MAV_LANDED_STATE_UNDEFINED = 0,
2578 #[doc = "MAV is landed (on ground)"]
2579 MAV_LANDED_STATE_ON_GROUND = 1,
2580 #[doc = "MAV is in air"]
2581 MAV_LANDED_STATE_IN_AIR = 2,
2582 #[doc = "MAV currently taking off"]
2583 MAV_LANDED_STATE_TAKEOFF = 3,
2584 #[doc = "MAV currently landing"]
2585 MAV_LANDED_STATE_LANDING = 4,
2586}
2587impl MavLandedState {
2588 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2589}
2590impl Default for MavLandedState {
2591 fn default() -> Self {
2592 Self::DEFAULT
2593 }
2594}
2595#[cfg_attr(feature = "ts", derive(TS))]
2596#[cfg_attr(feature = "ts", ts(export))]
2597#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2598#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2599#[cfg_attr(feature = "serde", serde(tag = "type"))]
2600#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2601#[repr(u32)]
2602#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2603pub enum MavMissionResult {
2604 #[doc = "mission accepted OK"]
2605 MAV_MISSION_ACCEPTED = 0,
2606 #[doc = "Generic error / not accepting mission commands at all right now."]
2607 MAV_MISSION_ERROR = 1,
2608 #[doc = "Coordinate frame is not supported."]
2609 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2610 #[doc = "Command is not supported."]
2611 MAV_MISSION_UNSUPPORTED = 3,
2612 #[doc = "Mission items exceed storage space."]
2613 MAV_MISSION_NO_SPACE = 4,
2614 #[doc = "One of the parameters has an invalid value."]
2615 MAV_MISSION_INVALID = 5,
2616 #[doc = "param1 has an invalid value."]
2617 MAV_MISSION_INVALID_PARAM1 = 6,
2618 #[doc = "param2 has an invalid value."]
2619 MAV_MISSION_INVALID_PARAM2 = 7,
2620 #[doc = "param3 has an invalid value."]
2621 MAV_MISSION_INVALID_PARAM3 = 8,
2622 #[doc = "param4 has an invalid value."]
2623 MAV_MISSION_INVALID_PARAM4 = 9,
2624 #[doc = "x / param5 has an invalid value."]
2625 MAV_MISSION_INVALID_PARAM5_X = 10,
2626 #[doc = "y / param6 has an invalid value."]
2627 MAV_MISSION_INVALID_PARAM6_Y = 11,
2628 #[doc = "z / param7 has an invalid value."]
2629 MAV_MISSION_INVALID_PARAM7 = 12,
2630 #[doc = "Mission item received out of sequence"]
2631 MAV_MISSION_INVALID_SEQUENCE = 13,
2632 #[doc = "Not accepting any mission commands from this communication partner."]
2633 MAV_MISSION_DENIED = 14,
2634 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2635 MAV_MISSION_OPERATION_CANCELLED = 15,
2636}
2637impl MavMissionResult {
2638 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2639}
2640impl Default for MavMissionResult {
2641 fn default() -> Self {
2642 Self::DEFAULT
2643 }
2644}
2645#[cfg_attr(feature = "ts", derive(TS))]
2646#[cfg_attr(feature = "ts", ts(export))]
2647#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2648#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2649#[cfg_attr(feature = "serde", serde(tag = "type"))]
2650#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2651#[repr(u32)]
2652#[doc = "Type of mission items being requested/sent in mission protocol."]
2653pub enum MavMissionType {
2654 #[doc = "Items are mission commands for main mission."]
2655 MAV_MISSION_TYPE_MISSION = 0,
2656 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2657 MAV_MISSION_TYPE_FENCE = 1,
2658 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2659 MAV_MISSION_TYPE_RALLY = 2,
2660 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2661 MAV_MISSION_TYPE_ALL = 255,
2662}
2663impl MavMissionType {
2664 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2665}
2666impl Default for MavMissionType {
2667 fn default() -> Self {
2668 Self::DEFAULT
2669 }
2670}
2671#[cfg_attr(feature = "ts", derive(TS))]
2672#[cfg_attr(feature = "ts", ts(export))]
2673#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2674#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2675#[cfg_attr(feature = "serde", serde(tag = "type"))]
2676#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2677#[repr(u32)]
2678#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2679pub enum MavMode {
2680 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2681 MAV_MODE_PREFLIGHT = 0,
2682 #[doc = "System is allowed to be active, under assisted RC control."]
2683 MAV_MODE_STABILIZE_DISARMED = 80,
2684 #[doc = "System is allowed to be active, under assisted RC control."]
2685 MAV_MODE_STABILIZE_ARMED = 208,
2686 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2687 MAV_MODE_MANUAL_DISARMED = 64,
2688 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2689 MAV_MODE_MANUAL_ARMED = 192,
2690 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2691 MAV_MODE_GUIDED_DISARMED = 88,
2692 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2693 MAV_MODE_GUIDED_ARMED = 216,
2694 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2695 MAV_MODE_AUTO_DISARMED = 92,
2696 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2697 MAV_MODE_AUTO_ARMED = 220,
2698 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2699 MAV_MODE_TEST_DISARMED = 66,
2700 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2701 MAV_MODE_TEST_ARMED = 194,
2702}
2703impl MavMode {
2704 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2705}
2706impl Default for MavMode {
2707 fn default() -> Self {
2708 Self::DEFAULT
2709 }
2710}
2711bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2712impl MavModeFlag {
2713 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2714}
2715impl Default for MavModeFlag {
2716 fn default() -> Self {
2717 Self::DEFAULT
2718 }
2719}
2720#[cfg_attr(feature = "ts", derive(TS))]
2721#[cfg_attr(feature = "ts", ts(export))]
2722#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2723#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2724#[cfg_attr(feature = "serde", serde(tag = "type"))]
2725#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2726#[repr(u32)]
2727#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2728pub enum MavModeFlagDecodePosition {
2729 #[doc = "First bit: 10000000"]
2730 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2731 #[doc = "Second bit: 01000000"]
2732 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2733 #[doc = "Third bit: 00100000"]
2734 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2735 #[doc = "Fourth bit: 00010000"]
2736 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2737 #[doc = "Fifth bit: 00001000"]
2738 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2739 #[doc = "Sixth bit: 00000100"]
2740 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2741 #[doc = "Seventh bit: 00000010"]
2742 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2743 #[doc = "Eighth bit: 00000001"]
2744 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2745}
2746impl MavModeFlagDecodePosition {
2747 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2748}
2749impl Default for MavModeFlagDecodePosition {
2750 fn default() -> Self {
2751 Self::DEFAULT
2752 }
2753}
2754bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2755impl MavModeProperty {
2756 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2757}
2758impl Default for MavModeProperty {
2759 fn default() -> Self {
2760 Self::DEFAULT
2761 }
2762}
2763#[cfg_attr(feature = "ts", derive(TS))]
2764#[cfg_attr(feature = "ts", ts(export))]
2765#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2766#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2767#[cfg_attr(feature = "serde", serde(tag = "type"))]
2768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2769#[repr(u32)]
2770#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2771#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2772pub enum MavMountMode {
2773 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2774 MAV_MOUNT_MODE_RETRACT = 0,
2775 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2776 MAV_MOUNT_MODE_NEUTRAL = 1,
2777 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2778 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2779 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2780 MAV_MOUNT_MODE_RC_TARGETING = 3,
2781 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2782 MAV_MOUNT_MODE_GPS_POINT = 4,
2783 #[doc = "Gimbal tracks system with specified system ID"]
2784 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2785 #[doc = "Gimbal tracks home position"]
2786 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2787}
2788impl MavMountMode {
2789 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2790}
2791impl Default for MavMountMode {
2792 fn default() -> Self {
2793 Self::DEFAULT
2794 }
2795}
2796#[cfg_attr(feature = "ts", derive(TS))]
2797#[cfg_attr(feature = "ts", ts(export))]
2798#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2799#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2800#[cfg_attr(feature = "serde", serde(tag = "type"))]
2801#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2802#[repr(u32)]
2803pub enum MavOdidArmStatus {
2804 #[doc = "Passing arming checks."]
2805 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2806 #[doc = "Generic arming failure, see error string for details."]
2807 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2808}
2809impl MavOdidArmStatus {
2810 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2811}
2812impl Default for MavOdidArmStatus {
2813 fn default() -> Self {
2814 Self::DEFAULT
2815 }
2816}
2817#[cfg_attr(feature = "ts", derive(TS))]
2818#[cfg_attr(feature = "ts", ts(export))]
2819#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2821#[cfg_attr(feature = "serde", serde(tag = "type"))]
2822#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2823#[repr(u32)]
2824pub enum MavOdidAuthType {
2825 #[doc = "No authentication type is specified."]
2826 MAV_ODID_AUTH_TYPE_NONE = 0,
2827 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2828 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2829 #[doc = "Signature for the Operator ID."]
2830 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2831 #[doc = "Signature for the entire message set."]
2832 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2833 #[doc = "Authentication is provided by Network Remote ID."]
2834 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2835 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2836 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2837}
2838impl MavOdidAuthType {
2839 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2840}
2841impl Default for MavOdidAuthType {
2842 fn default() -> Self {
2843 Self::DEFAULT
2844 }
2845}
2846#[cfg_attr(feature = "ts", derive(TS))]
2847#[cfg_attr(feature = "ts", ts(export))]
2848#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2849#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2850#[cfg_attr(feature = "serde", serde(tag = "type"))]
2851#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2852#[repr(u32)]
2853pub enum MavOdidCategoryEu {
2854 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2855 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2856 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2857 MAV_ODID_CATEGORY_EU_OPEN = 1,
2858 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2859 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2860 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2861 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2862}
2863impl MavOdidCategoryEu {
2864 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2865}
2866impl Default for MavOdidCategoryEu {
2867 fn default() -> Self {
2868 Self::DEFAULT
2869 }
2870}
2871#[cfg_attr(feature = "ts", derive(TS))]
2872#[cfg_attr(feature = "ts", ts(export))]
2873#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2874#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2875#[cfg_attr(feature = "serde", serde(tag = "type"))]
2876#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2877#[repr(u32)]
2878pub enum MavOdidClassEu {
2879 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2880 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2881 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2882 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2883 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2884 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2885 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2886 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2887 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2888 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2889 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2890 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2891 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2892 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2893 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2894 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2895}
2896impl MavOdidClassEu {
2897 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2898}
2899impl Default for MavOdidClassEu {
2900 fn default() -> Self {
2901 Self::DEFAULT
2902 }
2903}
2904#[cfg_attr(feature = "ts", derive(TS))]
2905#[cfg_attr(feature = "ts", ts(export))]
2906#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2907#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2908#[cfg_attr(feature = "serde", serde(tag = "type"))]
2909#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2910#[repr(u32)]
2911pub enum MavOdidClassificationType {
2912 #[doc = "The classification type for the UA is undeclared."]
2913 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2914 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2915 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2916}
2917impl MavOdidClassificationType {
2918 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2919}
2920impl Default for MavOdidClassificationType {
2921 fn default() -> Self {
2922 Self::DEFAULT
2923 }
2924}
2925#[cfg_attr(feature = "ts", derive(TS))]
2926#[cfg_attr(feature = "ts", ts(export))]
2927#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2928#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2929#[cfg_attr(feature = "serde", serde(tag = "type"))]
2930#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2931#[repr(u32)]
2932pub enum MavOdidDescType {
2933 #[doc = "Optional free-form text description of the purpose of the flight."]
2934 MAV_ODID_DESC_TYPE_TEXT = 0,
2935 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2936 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2937 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2938 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2939}
2940impl MavOdidDescType {
2941 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2942}
2943impl Default for MavOdidDescType {
2944 fn default() -> Self {
2945 Self::DEFAULT
2946 }
2947}
2948#[cfg_attr(feature = "ts", derive(TS))]
2949#[cfg_attr(feature = "ts", ts(export))]
2950#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2951#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2952#[cfg_attr(feature = "serde", serde(tag = "type"))]
2953#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2954#[repr(u32)]
2955pub enum MavOdidHeightRef {
2956 #[doc = "The height field is relative to the take-off location."]
2957 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2958 #[doc = "The height field is relative to ground."]
2959 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2960}
2961impl MavOdidHeightRef {
2962 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2963}
2964impl Default for MavOdidHeightRef {
2965 fn default() -> Self {
2966 Self::DEFAULT
2967 }
2968}
2969#[cfg_attr(feature = "ts", derive(TS))]
2970#[cfg_attr(feature = "ts", ts(export))]
2971#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2972#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2973#[cfg_attr(feature = "serde", serde(tag = "type"))]
2974#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2975#[repr(u32)]
2976pub enum MavOdidHorAcc {
2977 #[doc = "The horizontal accuracy is unknown."]
2978 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2979 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2980 MAV_ODID_HOR_ACC_10NM = 1,
2981 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2982 MAV_ODID_HOR_ACC_4NM = 2,
2983 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2984 MAV_ODID_HOR_ACC_2NM = 3,
2985 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2986 MAV_ODID_HOR_ACC_1NM = 4,
2987 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2988 MAV_ODID_HOR_ACC_0_5NM = 5,
2989 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2990 MAV_ODID_HOR_ACC_0_3NM = 6,
2991 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2992 MAV_ODID_HOR_ACC_0_1NM = 7,
2993 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2994 MAV_ODID_HOR_ACC_0_05NM = 8,
2995 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2996 MAV_ODID_HOR_ACC_30_METER = 9,
2997 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2998 MAV_ODID_HOR_ACC_10_METER = 10,
2999 #[doc = "The horizontal accuracy is smaller than 3 meter."]
3000 MAV_ODID_HOR_ACC_3_METER = 11,
3001 #[doc = "The horizontal accuracy is smaller than 1 meter."]
3002 MAV_ODID_HOR_ACC_1_METER = 12,
3003}
3004impl MavOdidHorAcc {
3005 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
3006}
3007impl Default for MavOdidHorAcc {
3008 fn default() -> Self {
3009 Self::DEFAULT
3010 }
3011}
3012#[cfg_attr(feature = "ts", derive(TS))]
3013#[cfg_attr(feature = "ts", ts(export))]
3014#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3015#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3016#[cfg_attr(feature = "serde", serde(tag = "type"))]
3017#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3018#[repr(u32)]
3019pub enum MavOdidIdType {
3020 #[doc = "No type defined."]
3021 MAV_ODID_ID_TYPE_NONE = 0,
3022 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
3023 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
3024 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
3025 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
3026 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
3027 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
3028 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
3029 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
3030}
3031impl MavOdidIdType {
3032 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
3033}
3034impl Default for MavOdidIdType {
3035 fn default() -> Self {
3036 Self::DEFAULT
3037 }
3038}
3039#[cfg_attr(feature = "ts", derive(TS))]
3040#[cfg_attr(feature = "ts", ts(export))]
3041#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3043#[cfg_attr(feature = "serde", serde(tag = "type"))]
3044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3045#[repr(u32)]
3046pub enum MavOdidOperatorIdType {
3047 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
3048 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
3049}
3050impl MavOdidOperatorIdType {
3051 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
3052}
3053impl Default for MavOdidOperatorIdType {
3054 fn default() -> Self {
3055 Self::DEFAULT
3056 }
3057}
3058#[cfg_attr(feature = "ts", derive(TS))]
3059#[cfg_attr(feature = "ts", ts(export))]
3060#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3062#[cfg_attr(feature = "serde", serde(tag = "type"))]
3063#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3064#[repr(u32)]
3065pub enum MavOdidOperatorLocationType {
3066 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3067 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3068 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3069 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3070 #[doc = "The location/altitude of the operator are fixed values."]
3071 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3072}
3073impl MavOdidOperatorLocationType {
3074 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3075}
3076impl Default for MavOdidOperatorLocationType {
3077 fn default() -> Self {
3078 Self::DEFAULT
3079 }
3080}
3081#[cfg_attr(feature = "ts", derive(TS))]
3082#[cfg_attr(feature = "ts", ts(export))]
3083#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3085#[cfg_attr(feature = "serde", serde(tag = "type"))]
3086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3087#[repr(u32)]
3088pub enum MavOdidSpeedAcc {
3089 #[doc = "The speed accuracy is unknown."]
3090 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3091 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3092 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3093 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3094 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3095 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3096 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3097 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3098 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3099}
3100impl MavOdidSpeedAcc {
3101 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3102}
3103impl Default for MavOdidSpeedAcc {
3104 fn default() -> Self {
3105 Self::DEFAULT
3106 }
3107}
3108#[cfg_attr(feature = "ts", derive(TS))]
3109#[cfg_attr(feature = "ts", ts(export))]
3110#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3111#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3112#[cfg_attr(feature = "serde", serde(tag = "type"))]
3113#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3114#[repr(u32)]
3115pub enum MavOdidStatus {
3116 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3117 MAV_ODID_STATUS_UNDECLARED = 0,
3118 #[doc = "The UA is on the ground."]
3119 MAV_ODID_STATUS_GROUND = 1,
3120 #[doc = "The UA is in the air."]
3121 MAV_ODID_STATUS_AIRBORNE = 2,
3122 #[doc = "The UA is having an emergency."]
3123 MAV_ODID_STATUS_EMERGENCY = 3,
3124 #[doc = "The remote ID system is failing or unreliable in some way."]
3125 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3126}
3127impl MavOdidStatus {
3128 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3129}
3130impl Default for MavOdidStatus {
3131 fn default() -> Self {
3132 Self::DEFAULT
3133 }
3134}
3135#[cfg_attr(feature = "ts", derive(TS))]
3136#[cfg_attr(feature = "ts", ts(export))]
3137#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3138#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3139#[cfg_attr(feature = "serde", serde(tag = "type"))]
3140#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3141#[repr(u32)]
3142pub enum MavOdidTimeAcc {
3143 #[doc = "The timestamp accuracy is unknown."]
3144 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3145 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3146 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3147 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3148 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3149 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3150 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3151 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3152 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3153 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3154 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3155 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3156 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3157 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3158 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3159 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3160 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3161 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3162 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3163 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3164 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3165 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3166 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3167 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3168 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3169 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3170 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3171 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3172 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3173 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3174 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3175}
3176impl MavOdidTimeAcc {
3177 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3178}
3179impl Default for MavOdidTimeAcc {
3180 fn default() -> Self {
3181 Self::DEFAULT
3182 }
3183}
3184#[cfg_attr(feature = "ts", derive(TS))]
3185#[cfg_attr(feature = "ts", ts(export))]
3186#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3187#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3188#[cfg_attr(feature = "serde", serde(tag = "type"))]
3189#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3190#[repr(u32)]
3191pub enum MavOdidUaType {
3192 #[doc = "No UA (Unmanned Aircraft) type defined."]
3193 MAV_ODID_UA_TYPE_NONE = 0,
3194 #[doc = "Aeroplane/Airplane. Fixed wing."]
3195 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3196 #[doc = "Helicopter or multirotor."]
3197 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3198 #[doc = "Gyroplane."]
3199 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3200 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3201 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3202 #[doc = "Ornithopter."]
3203 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3204 #[doc = "Glider."]
3205 MAV_ODID_UA_TYPE_GLIDER = 6,
3206 #[doc = "Kite."]
3207 MAV_ODID_UA_TYPE_KITE = 7,
3208 #[doc = "Free Balloon."]
3209 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3210 #[doc = "Captive Balloon."]
3211 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3212 #[doc = "Airship. E.g. a blimp."]
3213 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3214 #[doc = "Free Fall/Parachute (unpowered)."]
3215 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3216 #[doc = "Rocket."]
3217 MAV_ODID_UA_TYPE_ROCKET = 12,
3218 #[doc = "Tethered powered aircraft."]
3219 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3220 #[doc = "Ground Obstacle."]
3221 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3222 #[doc = "Other type of aircraft not listed earlier."]
3223 MAV_ODID_UA_TYPE_OTHER = 15,
3224}
3225impl MavOdidUaType {
3226 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3227}
3228impl Default for MavOdidUaType {
3229 fn default() -> Self {
3230 Self::DEFAULT
3231 }
3232}
3233#[cfg_attr(feature = "ts", derive(TS))]
3234#[cfg_attr(feature = "ts", ts(export))]
3235#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3236#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3237#[cfg_attr(feature = "serde", serde(tag = "type"))]
3238#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3239#[repr(u32)]
3240pub enum MavOdidVerAcc {
3241 #[doc = "The vertical accuracy is unknown."]
3242 MAV_ODID_VER_ACC_UNKNOWN = 0,
3243 #[doc = "The vertical accuracy is smaller than 150 meter."]
3244 MAV_ODID_VER_ACC_150_METER = 1,
3245 #[doc = "The vertical accuracy is smaller than 45 meter."]
3246 MAV_ODID_VER_ACC_45_METER = 2,
3247 #[doc = "The vertical accuracy is smaller than 25 meter."]
3248 MAV_ODID_VER_ACC_25_METER = 3,
3249 #[doc = "The vertical accuracy is smaller than 10 meter."]
3250 MAV_ODID_VER_ACC_10_METER = 4,
3251 #[doc = "The vertical accuracy is smaller than 3 meter."]
3252 MAV_ODID_VER_ACC_3_METER = 5,
3253 #[doc = "The vertical accuracy is smaller than 1 meter."]
3254 MAV_ODID_VER_ACC_1_METER = 6,
3255}
3256impl MavOdidVerAcc {
3257 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3258}
3259impl Default for MavOdidVerAcc {
3260 fn default() -> Self {
3261 Self::DEFAULT
3262 }
3263}
3264#[cfg_attr(feature = "ts", derive(TS))]
3265#[cfg_attr(feature = "ts", ts(export))]
3266#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3267#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3268#[cfg_attr(feature = "serde", serde(tag = "type"))]
3269#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3270#[repr(u32)]
3271#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3272pub enum MavParamExtType {
3273 #[doc = "8-bit unsigned integer"]
3274 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3275 #[doc = "8-bit signed integer"]
3276 MAV_PARAM_EXT_TYPE_INT8 = 2,
3277 #[doc = "16-bit unsigned integer"]
3278 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3279 #[doc = "16-bit signed integer"]
3280 MAV_PARAM_EXT_TYPE_INT16 = 4,
3281 #[doc = "32-bit unsigned integer"]
3282 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3283 #[doc = "32-bit signed integer"]
3284 MAV_PARAM_EXT_TYPE_INT32 = 6,
3285 #[doc = "64-bit unsigned integer"]
3286 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3287 #[doc = "64-bit signed integer"]
3288 MAV_PARAM_EXT_TYPE_INT64 = 8,
3289 #[doc = "32-bit floating-point"]
3290 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3291 #[doc = "64-bit floating-point"]
3292 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3293 #[doc = "Custom Type"]
3294 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3295}
3296impl MavParamExtType {
3297 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3298}
3299impl Default for MavParamExtType {
3300 fn default() -> Self {
3301 Self::DEFAULT
3302 }
3303}
3304#[cfg_attr(feature = "ts", derive(TS))]
3305#[cfg_attr(feature = "ts", ts(export))]
3306#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3307#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3308#[cfg_attr(feature = "serde", serde(tag = "type"))]
3309#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3310#[repr(u32)]
3311#[doc = "Specifies the datatype of a MAVLink parameter."]
3312pub enum MavParamType {
3313 #[doc = "8-bit unsigned integer"]
3314 MAV_PARAM_TYPE_UINT8 = 1,
3315 #[doc = "8-bit signed integer"]
3316 MAV_PARAM_TYPE_INT8 = 2,
3317 #[doc = "16-bit unsigned integer"]
3318 MAV_PARAM_TYPE_UINT16 = 3,
3319 #[doc = "16-bit signed integer"]
3320 MAV_PARAM_TYPE_INT16 = 4,
3321 #[doc = "32-bit unsigned integer"]
3322 MAV_PARAM_TYPE_UINT32 = 5,
3323 #[doc = "32-bit signed integer"]
3324 MAV_PARAM_TYPE_INT32 = 6,
3325 #[doc = "64-bit unsigned integer"]
3326 MAV_PARAM_TYPE_UINT64 = 7,
3327 #[doc = "64-bit signed integer"]
3328 MAV_PARAM_TYPE_INT64 = 8,
3329 #[doc = "32-bit floating-point"]
3330 MAV_PARAM_TYPE_REAL32 = 9,
3331 #[doc = "64-bit floating-point"]
3332 MAV_PARAM_TYPE_REAL64 = 10,
3333}
3334impl MavParamType {
3335 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3336}
3337impl Default for MavParamType {
3338 fn default() -> Self {
3339 Self::DEFAULT
3340 }
3341}
3342bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3343impl MavPowerStatus {
3344 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3345}
3346impl Default for MavPowerStatus {
3347 fn default() -> Self {
3348 Self::DEFAULT
3349 }
3350}
3351bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3352impl MavProtocolCapability {
3353 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3354}
3355impl Default for MavProtocolCapability {
3356 fn default() -> Self {
3357 Self::DEFAULT
3358 }
3359}
3360#[cfg_attr(feature = "ts", derive(TS))]
3361#[cfg_attr(feature = "ts", ts(export))]
3362#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3364#[cfg_attr(feature = "serde", serde(tag = "type"))]
3365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3366#[repr(u32)]
3367#[doc = "Result from a MAVLink command (MAV_CMD)"]
3368pub enum MavResult {
3369 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3370 MAV_RESULT_ACCEPTED = 0,
3371 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3372 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3373 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3374 MAV_RESULT_DENIED = 2,
3375 #[doc = "Command is not supported (unknown)."]
3376 MAV_RESULT_UNSUPPORTED = 3,
3377 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3378 MAV_RESULT_FAILED = 4,
3379 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3380 MAV_RESULT_IN_PROGRESS = 5,
3381 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3382 MAV_RESULT_CANCELLED = 6,
3383 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3384 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3385 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3386 MAV_RESULT_COMMAND_INT_ONLY = 8,
3387 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3388 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3389}
3390impl MavResult {
3391 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3392}
3393impl Default for MavResult {
3394 fn default() -> Self {
3395 Self::DEFAULT
3396 }
3397}
3398#[cfg_attr(feature = "ts", derive(TS))]
3399#[cfg_attr(feature = "ts", ts(export))]
3400#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3401#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3402#[cfg_attr(feature = "serde", serde(tag = "type"))]
3403#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3404#[repr(u32)]
3405#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3406#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3407pub enum MavRoi {
3408 #[doc = "No region of interest."]
3409 MAV_ROI_NONE = 0,
3410 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3411 MAV_ROI_WPNEXT = 1,
3412 #[doc = "Point toward given waypoint."]
3413 MAV_ROI_WPINDEX = 2,
3414 #[doc = "Point toward fixed location."]
3415 MAV_ROI_LOCATION = 3,
3416 #[doc = "Point toward of given id."]
3417 MAV_ROI_TARGET = 4,
3418}
3419impl MavRoi {
3420 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3421}
3422impl Default for MavRoi {
3423 fn default() -> Self {
3424 Self::DEFAULT
3425 }
3426}
3427#[cfg_attr(feature = "ts", derive(TS))]
3428#[cfg_attr(feature = "ts", ts(export))]
3429#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3431#[cfg_attr(feature = "serde", serde(tag = "type"))]
3432#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3433#[repr(u32)]
3434#[doc = "Enumeration of sensor orientation, according to its rotations"]
3435pub enum MavSensorOrientation {
3436 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3437 MAV_SENSOR_ROTATION_NONE = 0,
3438 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3439 MAV_SENSOR_ROTATION_YAW_45 = 1,
3440 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3441 MAV_SENSOR_ROTATION_YAW_90 = 2,
3442 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3443 MAV_SENSOR_ROTATION_YAW_135 = 3,
3444 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3445 MAV_SENSOR_ROTATION_YAW_180 = 4,
3446 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3447 MAV_SENSOR_ROTATION_YAW_225 = 5,
3448 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3449 MAV_SENSOR_ROTATION_YAW_270 = 6,
3450 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3451 MAV_SENSOR_ROTATION_YAW_315 = 7,
3452 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3453 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3454 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3455 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3456 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3457 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3458 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3459 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3460 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3461 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3462 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3463 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3464 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3465 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3466 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3467 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3468 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3469 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3470 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3471 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3472 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3473 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3474 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3475 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3476 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3477 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3478 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3479 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3480 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3481 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3482 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3483 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3484 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3485 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3486 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3487 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3488 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3489 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3490 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3491 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3492 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3493 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3494 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3495 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3496 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3497 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3498 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3499 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3500 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3501 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3502 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3503 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3504 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3505 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3506 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3507 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3508 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3509 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3510 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3511 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3512 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3513 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3514 #[doc = "Pitch: 315"]
3515 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3516 #[doc = "Roll: 90, Pitch: 315"]
3517 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3518 #[doc = "Custom orientation"]
3519 MAV_SENSOR_ROTATION_CUSTOM = 100,
3520}
3521impl MavSensorOrientation {
3522 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3523}
3524impl Default for MavSensorOrientation {
3525 fn default() -> Self {
3526 Self::DEFAULT
3527 }
3528}
3529#[cfg_attr(feature = "ts", derive(TS))]
3530#[cfg_attr(feature = "ts", ts(export))]
3531#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3532#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3533#[cfg_attr(feature = "serde", serde(tag = "type"))]
3534#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3535#[repr(u32)]
3536#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3537pub enum MavSeverity {
3538 #[doc = "System is unusable. This is a \"panic\" condition."]
3539 MAV_SEVERITY_EMERGENCY = 0,
3540 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3541 MAV_SEVERITY_ALERT = 1,
3542 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3543 MAV_SEVERITY_CRITICAL = 2,
3544 #[doc = "Indicates an error in secondary/redundant systems."]
3545 MAV_SEVERITY_ERROR = 3,
3546 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3547 MAV_SEVERITY_WARNING = 4,
3548 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3549 MAV_SEVERITY_NOTICE = 5,
3550 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3551 MAV_SEVERITY_INFO = 6,
3552 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3553 MAV_SEVERITY_DEBUG = 7,
3554}
3555impl MavSeverity {
3556 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3557}
3558impl Default for MavSeverity {
3559 fn default() -> Self {
3560 Self::DEFAULT
3561 }
3562}
3563#[cfg_attr(feature = "ts", derive(TS))]
3564#[cfg_attr(feature = "ts", ts(export))]
3565#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3567#[cfg_attr(feature = "serde", serde(tag = "type"))]
3568#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3569#[repr(u32)]
3570#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3571pub enum MavStandardMode {
3572 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3573 MAV_STANDARD_MODE_NON_STANDARD = 0,
3574 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3575 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3576 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3577 MAV_STANDARD_MODE_ORBIT = 2,
3578 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3579 MAV_STANDARD_MODE_CRUISE = 3,
3580 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3581 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3582 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3583 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3584 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3585 MAV_STANDARD_MODE_MISSION = 6,
3586 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3587 MAV_STANDARD_MODE_LAND = 7,
3588 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3589 MAV_STANDARD_MODE_TAKEOFF = 8,
3590}
3591impl MavStandardMode {
3592 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3593}
3594impl Default for MavStandardMode {
3595 fn default() -> Self {
3596 Self::DEFAULT
3597 }
3598}
3599#[cfg_attr(feature = "ts", derive(TS))]
3600#[cfg_attr(feature = "ts", ts(export))]
3601#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3602#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3603#[cfg_attr(feature = "serde", serde(tag = "type"))]
3604#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3605#[repr(u32)]
3606pub enum MavState {
3607 #[doc = "Uninitialized system, state is unknown."]
3608 MAV_STATE_UNINIT = 0,
3609 #[doc = "System is booting up."]
3610 MAV_STATE_BOOT = 1,
3611 #[doc = "System is calibrating and not flight-ready."]
3612 MAV_STATE_CALIBRATING = 2,
3613 #[doc = "System is grounded and on standby. It can be launched any time."]
3614 MAV_STATE_STANDBY = 3,
3615 #[doc = "System is active and might be already airborne. Motors are engaged."]
3616 MAV_STATE_ACTIVE = 4,
3617 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3618 MAV_STATE_CRITICAL = 5,
3619 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3620 MAV_STATE_EMERGENCY = 6,
3621 #[doc = "System just initialized its power-down sequence, will shut down now."]
3622 MAV_STATE_POWEROFF = 7,
3623 #[doc = "System is terminating itself (failsafe or commanded)."]
3624 MAV_STATE_FLIGHT_TERMINATION = 8,
3625}
3626impl MavState {
3627 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3628}
3629impl Default for MavState {
3630 fn default() -> Self {
3631 Self::DEFAULT
3632 }
3633}
3634bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3635impl MavSysStatusSensor {
3636 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3637}
3638impl Default for MavSysStatusSensor {
3639 fn default() -> Self {
3640 Self::DEFAULT
3641 }
3642}
3643bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3644impl MavSysStatusSensorExtended {
3645 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3646}
3647impl Default for MavSysStatusSensorExtended {
3648 fn default() -> Self {
3649 Self::DEFAULT
3650 }
3651}
3652#[cfg_attr(feature = "ts", derive(TS))]
3653#[cfg_attr(feature = "ts", ts(export))]
3654#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3656#[cfg_attr(feature = "serde", serde(tag = "type"))]
3657#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3658#[repr(u32)]
3659pub enum MavTunnelPayloadType {
3660 #[doc = "Encoding of payload unknown."]
3661 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3662 #[doc = "Registered for STorM32 gimbal controller."]
3663 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3664 #[doc = "Registered for STorM32 gimbal controller."]
3665 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3666 #[doc = "Registered for STorM32 gimbal controller."]
3667 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3668 #[doc = "Registered for STorM32 gimbal controller."]
3669 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3670 #[doc = "Registered for STorM32 gimbal controller."]
3671 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3672 #[doc = "Registered for STorM32 gimbal controller."]
3673 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3674 #[doc = "Registered for STorM32 gimbal controller."]
3675 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3676 #[doc = "Registered for STorM32 gimbal controller."]
3677 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3678 #[doc = "Registered for STorM32 gimbal controller."]
3679 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3680 #[doc = "Registered for STorM32 gimbal controller."]
3681 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3682 #[doc = "Registered for ModalAI remote OSD protocol."]
3683 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3684 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3685 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3686 #[doc = "Registered for ModalAI vendor use."]
3687 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3688}
3689impl MavTunnelPayloadType {
3690 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3691}
3692impl Default for MavTunnelPayloadType {
3693 fn default() -> Self {
3694 Self::DEFAULT
3695 }
3696}
3697#[cfg_attr(feature = "ts", derive(TS))]
3698#[cfg_attr(feature = "ts", ts(export))]
3699#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3700#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3701#[cfg_attr(feature = "serde", serde(tag = "type"))]
3702#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3703#[repr(u32)]
3704#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3705pub enum MavType {
3706 #[doc = "Generic micro air vehicle"]
3707 MAV_TYPE_GENERIC = 0,
3708 #[doc = "Fixed wing aircraft."]
3709 MAV_TYPE_FIXED_WING = 1,
3710 #[doc = "Quadrotor"]
3711 MAV_TYPE_QUADROTOR = 2,
3712 #[doc = "Coaxial helicopter"]
3713 MAV_TYPE_COAXIAL = 3,
3714 #[doc = "Normal helicopter with tail rotor."]
3715 MAV_TYPE_HELICOPTER = 4,
3716 #[doc = "Ground installation"]
3717 MAV_TYPE_ANTENNA_TRACKER = 5,
3718 #[doc = "Operator control unit / ground control station"]
3719 MAV_TYPE_GCS = 6,
3720 #[doc = "Airship, controlled"]
3721 MAV_TYPE_AIRSHIP = 7,
3722 #[doc = "Free balloon, uncontrolled"]
3723 MAV_TYPE_FREE_BALLOON = 8,
3724 #[doc = "Rocket"]
3725 MAV_TYPE_ROCKET = 9,
3726 #[doc = "Ground rover"]
3727 MAV_TYPE_GROUND_ROVER = 10,
3728 #[doc = "Surface vessel, boat, ship"]
3729 MAV_TYPE_SURFACE_BOAT = 11,
3730 #[doc = "Submarine"]
3731 MAV_TYPE_SUBMARINE = 12,
3732 #[doc = "Hexarotor"]
3733 MAV_TYPE_HEXAROTOR = 13,
3734 #[doc = "Octorotor"]
3735 MAV_TYPE_OCTOROTOR = 14,
3736 #[doc = "Tricopter"]
3737 MAV_TYPE_TRICOPTER = 15,
3738 #[doc = "Flapping wing"]
3739 MAV_TYPE_FLAPPING_WING = 16,
3740 #[doc = "Kite"]
3741 MAV_TYPE_KITE = 17,
3742 #[doc = "Onboard companion controller"]
3743 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3744 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3745 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3746 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3747 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3748 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3749 MAV_TYPE_VTOL_TILTROTOR = 21,
3750 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3751 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3752 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3753 MAV_TYPE_VTOL_TAILSITTER = 23,
3754 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3755 MAV_TYPE_VTOL_TILTWING = 24,
3756 #[doc = "VTOL reserved 5"]
3757 MAV_TYPE_VTOL_RESERVED5 = 25,
3758 #[doc = "Gimbal"]
3759 MAV_TYPE_GIMBAL = 26,
3760 #[doc = "ADSB system"]
3761 MAV_TYPE_ADSB = 27,
3762 #[doc = "Steerable, nonrigid airfoil"]
3763 MAV_TYPE_PARAFOIL = 28,
3764 #[doc = "Dodecarotor"]
3765 MAV_TYPE_DODECAROTOR = 29,
3766 #[doc = "Camera"]
3767 MAV_TYPE_CAMERA = 30,
3768 #[doc = "Charging station"]
3769 MAV_TYPE_CHARGING_STATION = 31,
3770 #[doc = "FLARM collision avoidance system"]
3771 MAV_TYPE_FLARM = 32,
3772 #[doc = "Servo"]
3773 MAV_TYPE_SERVO = 33,
3774 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3775 MAV_TYPE_ODID = 34,
3776 #[doc = "Decarotor"]
3777 MAV_TYPE_DECAROTOR = 35,
3778 #[doc = "Battery"]
3779 MAV_TYPE_BATTERY = 36,
3780 #[doc = "Parachute"]
3781 MAV_TYPE_PARACHUTE = 37,
3782 #[doc = "Log"]
3783 MAV_TYPE_LOG = 38,
3784 #[doc = "OSD"]
3785 MAV_TYPE_OSD = 39,
3786 #[doc = "IMU"]
3787 MAV_TYPE_IMU = 40,
3788 #[doc = "GPS"]
3789 MAV_TYPE_GPS = 41,
3790 #[doc = "Winch"]
3791 MAV_TYPE_WINCH = 42,
3792 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3793 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3794 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3795 MAV_TYPE_ILLUMINATOR = 44,
3796 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3797 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3798}
3799impl MavType {
3800 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3801}
3802impl Default for MavType {
3803 fn default() -> Self {
3804 Self::DEFAULT
3805 }
3806}
3807#[cfg_attr(feature = "ts", derive(TS))]
3808#[cfg_attr(feature = "ts", ts(export))]
3809#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3810#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3811#[cfg_attr(feature = "serde", serde(tag = "type"))]
3812#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3813#[repr(u32)]
3814#[doc = "Enumeration of VTOL states"]
3815pub enum MavVtolState {
3816 #[doc = "MAV is not configured as VTOL"]
3817 MAV_VTOL_STATE_UNDEFINED = 0,
3818 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3819 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3820 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3821 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3822 #[doc = "VTOL is in multicopter state"]
3823 MAV_VTOL_STATE_MC = 3,
3824 #[doc = "VTOL is in fixed-wing state"]
3825 MAV_VTOL_STATE_FW = 4,
3826}
3827impl MavVtolState {
3828 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3829}
3830impl Default for MavVtolState {
3831 fn default() -> Self {
3832 Self::DEFAULT
3833 }
3834}
3835bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3836impl MavWinchStatusFlag {
3837 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3838}
3839impl Default for MavWinchStatusFlag {
3840 fn default() -> Self {
3841 Self::DEFAULT
3842 }
3843}
3844#[cfg_attr(feature = "ts", derive(TS))]
3845#[cfg_attr(feature = "ts", ts(export))]
3846#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3847#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3848#[cfg_attr(feature = "serde", serde(tag = "type"))]
3849#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3850#[repr(u32)]
3851pub enum MavlinkDataStreamType {
3852 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3853 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3854 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3855 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3856 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3857 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3858}
3859impl MavlinkDataStreamType {
3860 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3861}
3862impl Default for MavlinkDataStreamType {
3863 fn default() -> Self {
3864 Self::DEFAULT
3865 }
3866}
3867#[cfg_attr(feature = "ts", derive(TS))]
3868#[cfg_attr(feature = "ts", ts(export))]
3869#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3870#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3871#[cfg_attr(feature = "serde", serde(tag = "type"))]
3872#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3873#[repr(u32)]
3874#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3875pub enum MissionState {
3876 #[doc = "The mission status reporting is not supported."]
3877 MISSION_STATE_UNKNOWN = 0,
3878 #[doc = "No mission on the vehicle."]
3879 MISSION_STATE_NO_MISSION = 1,
3880 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3881 MISSION_STATE_NOT_STARTED = 2,
3882 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3883 MISSION_STATE_ACTIVE = 3,
3884 #[doc = "Mission is paused when in auto mode."]
3885 MISSION_STATE_PAUSED = 4,
3886 #[doc = "Mission has executed all mission items."]
3887 MISSION_STATE_COMPLETE = 5,
3888}
3889impl MissionState {
3890 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3891}
3892impl Default for MissionState {
3893 fn default() -> Self {
3894 Self::DEFAULT
3895 }
3896}
3897#[cfg_attr(feature = "ts", derive(TS))]
3898#[cfg_attr(feature = "ts", ts(export))]
3899#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3900#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3901#[cfg_attr(feature = "serde", serde(tag = "type"))]
3902#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3903#[repr(u32)]
3904#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3905pub enum MotorTestOrder {
3906 #[doc = "Default autopilot motor test method."]
3907 MOTOR_TEST_ORDER_DEFAULT = 0,
3908 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3909 MOTOR_TEST_ORDER_SEQUENCE = 1,
3910 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3911 MOTOR_TEST_ORDER_BOARD = 2,
3912}
3913impl MotorTestOrder {
3914 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3915}
3916impl Default for MotorTestOrder {
3917 fn default() -> Self {
3918 Self::DEFAULT
3919 }
3920}
3921#[cfg_attr(feature = "ts", derive(TS))]
3922#[cfg_attr(feature = "ts", ts(export))]
3923#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3924#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3925#[cfg_attr(feature = "serde", serde(tag = "type"))]
3926#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3927#[repr(u32)]
3928#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3929pub enum MotorTestThrottleType {
3930 #[doc = "Throttle as a percentage (0 ~ 100)"]
3931 MOTOR_TEST_THROTTLE_PERCENT = 0,
3932 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3933 MOTOR_TEST_THROTTLE_PWM = 1,
3934 #[doc = "Throttle pass-through from pilot's transmitter."]
3935 MOTOR_TEST_THROTTLE_PILOT = 2,
3936 #[doc = "Per-motor compass calibration test."]
3937 MOTOR_TEST_COMPASS_CAL = 3,
3938}
3939impl MotorTestThrottleType {
3940 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3941}
3942impl Default for MotorTestThrottleType {
3943 fn default() -> Self {
3944 Self::DEFAULT
3945 }
3946}
3947#[cfg_attr(feature = "ts", derive(TS))]
3948#[cfg_attr(feature = "ts", ts(export))]
3949#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3951#[cfg_attr(feature = "serde", serde(tag = "type"))]
3952#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3953#[repr(u32)]
3954pub enum NavVtolLandOptions {
3955 #[doc = "Default autopilot landing behaviour."]
3956 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3957 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3958 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3959 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3960 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3961}
3962impl NavVtolLandOptions {
3963 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3964}
3965impl Default for NavVtolLandOptions {
3966 fn default() -> Self {
3967 Self::DEFAULT
3968 }
3969}
3970#[cfg_attr(feature = "ts", derive(TS))]
3971#[cfg_attr(feature = "ts", ts(export))]
3972#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3973#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3974#[cfg_attr(feature = "serde", serde(tag = "type"))]
3975#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3976#[repr(u32)]
3977#[doc = "Yaw behaviour during orbit flight."]
3978pub enum OrbitYawBehaviour {
3979 #[doc = "Vehicle front points to the center (default)."]
3980 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3981 #[doc = "Vehicle front holds heading when message received."]
3982 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3983 #[doc = "Yaw uncontrolled."]
3984 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3985 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3986 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3987 #[doc = "Yaw controlled by RC input."]
3988 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3989 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3990 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3991}
3992impl OrbitYawBehaviour {
3993 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3994}
3995impl Default for OrbitYawBehaviour {
3996 fn default() -> Self {
3997 Self::DEFAULT
3998 }
3999}
4000#[cfg_attr(feature = "ts", derive(TS))]
4001#[cfg_attr(feature = "ts", ts(export))]
4002#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4003#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4004#[cfg_attr(feature = "serde", serde(tag = "type"))]
4005#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4006#[repr(u32)]
4007#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
4008pub enum ParachuteAction {
4009 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
4010 PARACHUTE_DISABLE = 0,
4011 #[doc = "Enable auto-release of parachute."]
4012 PARACHUTE_ENABLE = 1,
4013 #[doc = "Release parachute and kill motors."]
4014 PARACHUTE_RELEASE = 2,
4015}
4016impl ParachuteAction {
4017 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
4018}
4019impl Default for ParachuteAction {
4020 fn default() -> Self {
4021 Self::DEFAULT
4022 }
4023}
4024#[cfg_attr(feature = "ts", derive(TS))]
4025#[cfg_attr(feature = "ts", ts(export))]
4026#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4027#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4028#[cfg_attr(feature = "serde", serde(tag = "type"))]
4029#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4030#[repr(u32)]
4031#[doc = "Result from PARAM_EXT_SET message."]
4032pub enum ParamAck {
4033 #[doc = "Parameter value ACCEPTED and SET"]
4034 PARAM_ACK_ACCEPTED = 0,
4035 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
4036 PARAM_ACK_VALUE_UNSUPPORTED = 1,
4037 #[doc = "Parameter failed to set"]
4038 PARAM_ACK_FAILED = 2,
4039 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
4040 PARAM_ACK_IN_PROGRESS = 3,
4041}
4042impl ParamAck {
4043 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
4044}
4045impl Default for ParamAck {
4046 fn default() -> Self {
4047 Self::DEFAULT
4048 }
4049}
4050bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
4051impl PositionTargetTypemask {
4052 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
4053}
4054impl Default for PositionTargetTypemask {
4055 fn default() -> Self {
4056 Self::DEFAULT
4057 }
4058}
4059#[cfg_attr(feature = "ts", derive(TS))]
4060#[cfg_attr(feature = "ts", ts(export))]
4061#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4062#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4063#[cfg_attr(feature = "serde", serde(tag = "type"))]
4064#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4065#[repr(u32)]
4066#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
4067pub enum PrecisionLandMode {
4068 #[doc = "Normal (non-precision) landing."]
4069 PRECISION_LAND_MODE_DISABLED = 0,
4070 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
4071 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
4072 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
4073 PRECISION_LAND_MODE_REQUIRED = 2,
4074}
4075impl PrecisionLandMode {
4076 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
4077}
4078impl Default for PrecisionLandMode {
4079 fn default() -> Self {
4080 Self::DEFAULT
4081 }
4082}
4083#[cfg_attr(feature = "ts", derive(TS))]
4084#[cfg_attr(feature = "ts", ts(export))]
4085#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4087#[cfg_attr(feature = "serde", serde(tag = "type"))]
4088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4089#[repr(u32)]
4090#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4091pub enum PreflightStorageMissionAction {
4092 #[doc = "Read current mission data from persistent storage"]
4093 MISSION_READ_PERSISTENT = 0,
4094 #[doc = "Write current mission data to persistent storage"]
4095 MISSION_WRITE_PERSISTENT = 1,
4096 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
4097 MISSION_RESET_DEFAULT = 2,
4098}
4099impl PreflightStorageMissionAction {
4100 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
4101}
4102impl Default for PreflightStorageMissionAction {
4103 fn default() -> Self {
4104 Self::DEFAULT
4105 }
4106}
4107#[cfg_attr(feature = "ts", derive(TS))]
4108#[cfg_attr(feature = "ts", ts(export))]
4109#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4110#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4111#[cfg_attr(feature = "serde", serde(tag = "type"))]
4112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4113#[repr(u32)]
4114#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4115pub enum PreflightStorageParameterAction {
4116 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4117 PARAM_READ_PERSISTENT = 0,
4118 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4119 PARAM_WRITE_PERSISTENT = 1,
4120 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4121 PARAM_RESET_CONFIG_DEFAULT = 2,
4122 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4123 PARAM_RESET_SENSOR_DEFAULT = 3,
4124 #[doc = "Reset all parameters, including operation counters, to default values"]
4125 PARAM_RESET_ALL_DEFAULT = 4,
4126}
4127impl PreflightStorageParameterAction {
4128 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4129}
4130impl Default for PreflightStorageParameterAction {
4131 fn default() -> Self {
4132 Self::DEFAULT
4133 }
4134}
4135#[cfg_attr(feature = "ts", derive(TS))]
4136#[cfg_attr(feature = "ts", ts(export))]
4137#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4138#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4139#[cfg_attr(feature = "serde", serde(tag = "type"))]
4140#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4141#[repr(u32)]
4142#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
4143pub enum RcSubType {
4144 #[doc = "Spektrum DSM2"]
4145 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4146 #[doc = "Spektrum DSMX"]
4147 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4148 #[doc = "Spektrum DSMX8"]
4149 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4150}
4151impl RcSubType {
4152 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4153}
4154impl Default for RcSubType {
4155 fn default() -> Self {
4156 Self::DEFAULT
4157 }
4158}
4159#[cfg_attr(feature = "ts", derive(TS))]
4160#[cfg_attr(feature = "ts", ts(export))]
4161#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4163#[cfg_attr(feature = "serde", serde(tag = "type"))]
4164#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4165#[repr(u32)]
4166#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4167pub enum RcType {
4168 #[doc = "Spektrum"]
4169 RC_TYPE_SPEKTRUM = 0,
4170 #[doc = "CRSF"]
4171 RC_TYPE_CRSF = 1,
4172}
4173impl RcType {
4174 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4175}
4176impl Default for RcType {
4177 fn default() -> Self {
4178 Self::DEFAULT
4179 }
4180}
4181#[cfg_attr(feature = "ts", derive(TS))]
4182#[cfg_attr(feature = "ts", ts(export))]
4183#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4184#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4185#[cfg_attr(feature = "serde", serde(tag = "type"))]
4186#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4187#[repr(u32)]
4188#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4189pub enum RebootShutdownConditions {
4190 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4191 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4192 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4193 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4194}
4195impl RebootShutdownConditions {
4196 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4197}
4198impl Default for RebootShutdownConditions {
4199 fn default() -> Self {
4200 Self::DEFAULT
4201 }
4202}
4203#[cfg_attr(feature = "ts", derive(TS))]
4204#[cfg_attr(feature = "ts", ts(export))]
4205#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4206#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4207#[cfg_attr(feature = "serde", serde(tag = "type"))]
4208#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4209#[repr(u32)]
4210#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4211pub enum RtkBaselineCoordinateSystem {
4212 #[doc = "Earth-centered, Earth-fixed"]
4213 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4214 #[doc = "RTK basestation centered, north, east, down"]
4215 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4216}
4217impl RtkBaselineCoordinateSystem {
4218 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4219}
4220impl Default for RtkBaselineCoordinateSystem {
4221 fn default() -> Self {
4222 Self::DEFAULT
4223 }
4224}
4225#[cfg_attr(feature = "ts", derive(TS))]
4226#[cfg_attr(feature = "ts", ts(export))]
4227#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4228#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4229#[cfg_attr(feature = "serde", serde(tag = "type"))]
4230#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4231#[repr(u32)]
4232#[doc = "Possible safety switch states."]
4233pub enum SafetySwitchState {
4234 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4235 SAFETY_SWITCH_STATE_SAFE = 0,
4236 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4237 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4238}
4239impl SafetySwitchState {
4240 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4241}
4242impl Default for SafetySwitchState {
4243 fn default() -> Self {
4244 Self::DEFAULT
4245 }
4246}
4247#[cfg_attr(feature = "ts", derive(TS))]
4248#[cfg_attr(feature = "ts", ts(export))]
4249#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4250#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4251#[cfg_attr(feature = "serde", serde(tag = "type"))]
4252#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4253#[repr(u32)]
4254#[doc = "SERIAL_CONTROL device types"]
4255pub enum SerialControlDev {
4256 #[doc = "First telemetry port"]
4257 SERIAL_CONTROL_DEV_TELEM1 = 0,
4258 #[doc = "Second telemetry port"]
4259 SERIAL_CONTROL_DEV_TELEM2 = 1,
4260 #[doc = "First GPS port"]
4261 SERIAL_CONTROL_DEV_GPS1 = 2,
4262 #[doc = "Second GPS port"]
4263 SERIAL_CONTROL_DEV_GPS2 = 3,
4264 #[doc = "system shell"]
4265 SERIAL_CONTROL_DEV_SHELL = 10,
4266 #[doc = "SERIAL0"]
4267 SERIAL_CONTROL_SERIAL0 = 100,
4268 #[doc = "SERIAL1"]
4269 SERIAL_CONTROL_SERIAL1 = 101,
4270 #[doc = "SERIAL2"]
4271 SERIAL_CONTROL_SERIAL2 = 102,
4272 #[doc = "SERIAL3"]
4273 SERIAL_CONTROL_SERIAL3 = 103,
4274 #[doc = "SERIAL4"]
4275 SERIAL_CONTROL_SERIAL4 = 104,
4276 #[doc = "SERIAL5"]
4277 SERIAL_CONTROL_SERIAL5 = 105,
4278 #[doc = "SERIAL6"]
4279 SERIAL_CONTROL_SERIAL6 = 106,
4280 #[doc = "SERIAL7"]
4281 SERIAL_CONTROL_SERIAL7 = 107,
4282 #[doc = "SERIAL8"]
4283 SERIAL_CONTROL_SERIAL8 = 108,
4284 #[doc = "SERIAL9"]
4285 SERIAL_CONTROL_SERIAL9 = 109,
4286}
4287impl SerialControlDev {
4288 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4289}
4290impl Default for SerialControlDev {
4291 fn default() -> Self {
4292 Self::DEFAULT
4293 }
4294}
4295bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4296impl SerialControlFlag {
4297 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4298}
4299impl Default for SerialControlFlag {
4300 fn default() -> Self {
4301 Self::DEFAULT
4302 }
4303}
4304#[cfg_attr(feature = "ts", derive(TS))]
4305#[cfg_attr(feature = "ts", ts(export))]
4306#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4307#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4308#[cfg_attr(feature = "serde", serde(tag = "type"))]
4309#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4310#[repr(u32)]
4311#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4312pub enum SetFocusType {
4313 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4314 FOCUS_TYPE_STEP = 0,
4315 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4316 FOCUS_TYPE_CONTINUOUS = 1,
4317 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4318 FOCUS_TYPE_RANGE = 2,
4319 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4320 FOCUS_TYPE_METERS = 3,
4321 #[doc = "Focus automatically."]
4322 FOCUS_TYPE_AUTO = 4,
4323 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4324 FOCUS_TYPE_AUTO_SINGLE = 5,
4325 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4326 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4327}
4328impl SetFocusType {
4329 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4330}
4331impl Default for SetFocusType {
4332 fn default() -> Self {
4333 Self::DEFAULT
4334 }
4335}
4336#[cfg_attr(feature = "ts", derive(TS))]
4337#[cfg_attr(feature = "ts", ts(export))]
4338#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4340#[cfg_attr(feature = "serde", serde(tag = "type"))]
4341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4342#[repr(u32)]
4343#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4344pub enum SpeedType {
4345 #[doc = "Airspeed"]
4346 SPEED_TYPE_AIRSPEED = 0,
4347 #[doc = "Groundspeed"]
4348 SPEED_TYPE_GROUNDSPEED = 1,
4349 #[doc = "Climb speed"]
4350 SPEED_TYPE_CLIMB_SPEED = 2,
4351 #[doc = "Descent speed"]
4352 SPEED_TYPE_DESCENT_SPEED = 3,
4353}
4354impl SpeedType {
4355 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4356}
4357impl Default for SpeedType {
4358 fn default() -> Self {
4359 Self::DEFAULT
4360 }
4361}
4362#[cfg_attr(feature = "ts", derive(TS))]
4363#[cfg_attr(feature = "ts", ts(export))]
4364#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4366#[cfg_attr(feature = "serde", serde(tag = "type"))]
4367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4368#[repr(u32)]
4369#[doc = "Flags to indicate the status of camera storage."]
4370pub enum StorageStatus {
4371 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4372 STORAGE_STATUS_EMPTY = 0,
4373 #[doc = "Storage present but unformatted."]
4374 STORAGE_STATUS_UNFORMATTED = 1,
4375 #[doc = "Storage present and ready."]
4376 STORAGE_STATUS_READY = 2,
4377 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4378 STORAGE_STATUS_NOT_SUPPORTED = 3,
4379}
4380impl StorageStatus {
4381 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4382}
4383impl Default for StorageStatus {
4384 fn default() -> Self {
4385 Self::DEFAULT
4386 }
4387}
4388#[cfg_attr(feature = "ts", derive(TS))]
4389#[cfg_attr(feature = "ts", ts(export))]
4390#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4392#[cfg_attr(feature = "serde", serde(tag = "type"))]
4393#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4394#[repr(u32)]
4395#[doc = "Flags to indicate the type of storage."]
4396pub enum StorageType {
4397 #[doc = "Storage type is not known."]
4398 STORAGE_TYPE_UNKNOWN = 0,
4399 #[doc = "Storage type is USB device."]
4400 STORAGE_TYPE_USB_STICK = 1,
4401 #[doc = "Storage type is SD card."]
4402 STORAGE_TYPE_SD = 2,
4403 #[doc = "Storage type is microSD card."]
4404 STORAGE_TYPE_MICROSD = 3,
4405 #[doc = "Storage type is CFast."]
4406 STORAGE_TYPE_CF = 4,
4407 #[doc = "Storage type is CFexpress."]
4408 STORAGE_TYPE_CFE = 5,
4409 #[doc = "Storage type is XQD."]
4410 STORAGE_TYPE_XQD = 6,
4411 #[doc = "Storage type is HD mass storage type."]
4412 STORAGE_TYPE_HD = 7,
4413 #[doc = "Storage type is other, not listed type."]
4414 STORAGE_TYPE_OTHER = 254,
4415}
4416impl StorageType {
4417 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4418}
4419impl Default for StorageType {
4420 fn default() -> Self {
4421 Self::DEFAULT
4422 }
4423}
4424bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4425impl StorageUsageFlag {
4426 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4427}
4428impl Default for StorageUsageFlag {
4429 fn default() -> Self {
4430 Self::DEFAULT
4431 }
4432}
4433#[cfg_attr(feature = "ts", derive(TS))]
4434#[cfg_attr(feature = "ts", ts(export))]
4435#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4436#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4437#[cfg_attr(feature = "serde", serde(tag = "type"))]
4438#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4439#[repr(u32)]
4440#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4441pub enum TuneFormat {
4442 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4443 TUNE_FORMAT_QBASIC1_1 = 1,
4444 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4445 TUNE_FORMAT_MML_MODERN = 2,
4446}
4447impl TuneFormat {
4448 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4449}
4450impl Default for TuneFormat {
4451 fn default() -> Self {
4452 Self::DEFAULT
4453 }
4454}
4455#[cfg_attr(feature = "ts", derive(TS))]
4456#[cfg_attr(feature = "ts", ts(export))]
4457#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4458#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4459#[cfg_attr(feature = "serde", serde(tag = "type"))]
4460#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4461#[repr(u32)]
4462#[doc = "Generalized UAVCAN node health"]
4463pub enum UavcanNodeHealth {
4464 #[doc = "The node is functioning properly."]
4465 UAVCAN_NODE_HEALTH_OK = 0,
4466 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4467 UAVCAN_NODE_HEALTH_WARNING = 1,
4468 #[doc = "The node has encountered a major failure."]
4469 UAVCAN_NODE_HEALTH_ERROR = 2,
4470 #[doc = "The node has suffered a fatal malfunction."]
4471 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4472}
4473impl UavcanNodeHealth {
4474 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4475}
4476impl Default for UavcanNodeHealth {
4477 fn default() -> Self {
4478 Self::DEFAULT
4479 }
4480}
4481#[cfg_attr(feature = "ts", derive(TS))]
4482#[cfg_attr(feature = "ts", ts(export))]
4483#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4484#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4485#[cfg_attr(feature = "serde", serde(tag = "type"))]
4486#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4487#[repr(u32)]
4488#[doc = "Generalized UAVCAN node mode"]
4489pub enum UavcanNodeMode {
4490 #[doc = "The node is performing its primary functions."]
4491 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4492 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4493 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4494 #[doc = "The node is under maintenance."]
4495 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4496 #[doc = "The node is in the process of updating its software."]
4497 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4498 #[doc = "The node is no longer available online."]
4499 UAVCAN_NODE_MODE_OFFLINE = 7,
4500}
4501impl UavcanNodeMode {
4502 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4503}
4504impl Default for UavcanNodeMode {
4505 fn default() -> Self {
4506 Self::DEFAULT
4507 }
4508}
4509bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4510impl UtmDataAvailFlags {
4511 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4512}
4513impl Default for UtmDataAvailFlags {
4514 fn default() -> Self {
4515 Self::DEFAULT
4516 }
4517}
4518#[cfg_attr(feature = "ts", derive(TS))]
4519#[cfg_attr(feature = "ts", ts(export))]
4520#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4521#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4522#[cfg_attr(feature = "serde", serde(tag = "type"))]
4523#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4524#[repr(u32)]
4525#[doc = "Airborne status of UAS."]
4526pub enum UtmFlightState {
4527 #[doc = "The flight state can't be determined."]
4528 UTM_FLIGHT_STATE_UNKNOWN = 1,
4529 #[doc = "UAS on ground."]
4530 UTM_FLIGHT_STATE_GROUND = 2,
4531 #[doc = "UAS airborne."]
4532 UTM_FLIGHT_STATE_AIRBORNE = 3,
4533 #[doc = "UAS is in an emergency flight state."]
4534 UTM_FLIGHT_STATE_EMERGENCY = 16,
4535 #[doc = "UAS has no active controls."]
4536 UTM_FLIGHT_STATE_NOCTRL = 32,
4537}
4538impl UtmFlightState {
4539 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4540}
4541impl Default for UtmFlightState {
4542 fn default() -> Self {
4543 Self::DEFAULT
4544 }
4545}
4546#[cfg_attr(feature = "ts", derive(TS))]
4547#[cfg_attr(feature = "ts", ts(export))]
4548#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4549#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4550#[cfg_attr(feature = "serde", serde(tag = "type"))]
4551#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4552#[repr(u32)]
4553#[doc = "Video stream encodings"]
4554pub enum VideoStreamEncoding {
4555 #[doc = "Stream encoding is unknown"]
4556 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4557 #[doc = "Stream encoding is H.264"]
4558 VIDEO_STREAM_ENCODING_H264 = 1,
4559 #[doc = "Stream encoding is H.265"]
4560 VIDEO_STREAM_ENCODING_H265 = 2,
4561}
4562impl VideoStreamEncoding {
4563 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4564}
4565impl Default for VideoStreamEncoding {
4566 fn default() -> Self {
4567 Self::DEFAULT
4568 }
4569}
4570bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4571impl VideoStreamStatusFlags {
4572 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4573}
4574impl Default for VideoStreamStatusFlags {
4575 fn default() -> Self {
4576 Self::DEFAULT
4577 }
4578}
4579#[cfg_attr(feature = "ts", derive(TS))]
4580#[cfg_attr(feature = "ts", ts(export))]
4581#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4582#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4583#[cfg_attr(feature = "serde", serde(tag = "type"))]
4584#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4585#[repr(u32)]
4586#[doc = "Video stream types"]
4587pub enum VideoStreamType {
4588 #[doc = "Stream is RTSP"]
4589 VIDEO_STREAM_TYPE_RTSP = 0,
4590 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4591 VIDEO_STREAM_TYPE_RTPUDP = 1,
4592 #[doc = "Stream is MPEG on TCP"]
4593 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4594 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4595 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4596}
4597impl VideoStreamType {
4598 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4599}
4600impl Default for VideoStreamType {
4601 fn default() -> Self {
4602 Self::DEFAULT
4603 }
4604}
4605#[cfg_attr(feature = "ts", derive(TS))]
4606#[cfg_attr(feature = "ts", ts(export))]
4607#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4609#[cfg_attr(feature = "serde", serde(tag = "type"))]
4610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4611#[repr(u32)]
4612#[doc = "Direction of VTOL transition"]
4613pub enum VtolTransitionHeading {
4614 #[doc = "Respect the heading configuration of the vehicle."]
4615 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4616 #[doc = "Use the heading pointing towards the next waypoint."]
4617 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4618 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4619 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4620 #[doc = "Use the specified heading in parameter 4."]
4621 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4622 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4623 VTOL_TRANSITION_HEADING_ANY = 4,
4624}
4625impl VtolTransitionHeading {
4626 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4627}
4628impl Default for VtolTransitionHeading {
4629 fn default() -> Self {
4630 Self::DEFAULT
4631 }
4632}
4633#[cfg_attr(feature = "ts", derive(TS))]
4634#[cfg_attr(feature = "ts", ts(export))]
4635#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4636#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4637#[cfg_attr(feature = "serde", serde(tag = "type"))]
4638#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4639#[repr(u32)]
4640#[doc = "WiFi Mode."]
4641pub enum WifiConfigApMode {
4642 #[doc = "WiFi mode is undefined."]
4643 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4644 #[doc = "WiFi configured as an access point."]
4645 WIFI_CONFIG_AP_MODE_AP = 1,
4646 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4647 WIFI_CONFIG_AP_MODE_STATION = 2,
4648 #[doc = "WiFi disabled."]
4649 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4650}
4651impl WifiConfigApMode {
4652 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4653}
4654impl Default for WifiConfigApMode {
4655 fn default() -> Self {
4656 Self::DEFAULT
4657 }
4658}
4659#[cfg_attr(feature = "ts", derive(TS))]
4660#[cfg_attr(feature = "ts", ts(export))]
4661#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4662#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4663#[cfg_attr(feature = "serde", serde(tag = "type"))]
4664#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4665#[repr(u32)]
4666#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4667pub enum WifiConfigApResponse {
4668 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4669 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4670 #[doc = "Changes accepted."]
4671 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4672 #[doc = "Changes rejected."]
4673 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4674 #[doc = "Invalid Mode."]
4675 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4676 #[doc = "Invalid SSID."]
4677 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4678 #[doc = "Invalid Password."]
4679 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4680}
4681impl WifiConfigApResponse {
4682 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4683}
4684impl Default for WifiConfigApResponse {
4685 fn default() -> Self {
4686 Self::DEFAULT
4687 }
4688}
4689#[cfg_attr(feature = "ts", derive(TS))]
4690#[cfg_attr(feature = "ts", ts(export))]
4691#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4692#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4693#[cfg_attr(feature = "serde", serde(tag = "type"))]
4694#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4695#[repr(u32)]
4696#[doc = "Winch actions."]
4697pub enum WinchActions {
4698 #[doc = "Allow motor to freewheel."]
4699 WINCH_RELAXED = 0,
4700 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4701 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4702 #[doc = "Wind or unwind line at specified rate."]
4703 WINCH_RATE_CONTROL = 2,
4704 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4705 WINCH_LOCK = 3,
4706 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4707 WINCH_DELIVER = 4,
4708 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4709 WINCH_HOLD = 5,
4710 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4711 WINCH_RETRACT = 6,
4712 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4713 WINCH_LOAD_LINE = 7,
4714 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4715 WINCH_ABANDON_LINE = 8,
4716 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4717 WINCH_LOAD_PAYLOAD = 9,
4718}
4719impl WinchActions {
4720 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4721}
4722impl Default for WinchActions {
4723 fn default() -> Self {
4724 Self::DEFAULT
4725 }
4726}
4727#[doc = "Set the vehicle attitude and body angular rates."]
4728#[doc = ""]
4729#[doc = "ID: 140"]
4730#[derive(Debug, Clone, PartialEq)]
4731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4733#[cfg_attr(feature = "ts", derive(TS))]
4734#[cfg_attr(feature = "ts", ts(export))]
4735pub struct ACTUATOR_CONTROL_TARGET_DATA {
4736 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4737 pub time_usec: u64,
4738 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4739 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4740 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4741 pub controls: [f32; 8],
4742 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4743 pub group_mlx: u8,
4744}
4745impl ACTUATOR_CONTROL_TARGET_DATA {
4746 pub const ENCODED_LEN: usize = 41usize;
4747 pub const DEFAULT: Self = Self {
4748 time_usec: 0_u64,
4749 controls: [0.0_f32; 8usize],
4750 group_mlx: 0_u8,
4751 };
4752 #[cfg(feature = "arbitrary")]
4753 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4754 use arbitrary::{Arbitrary, Unstructured};
4755 let mut buf = [0u8; 1024];
4756 rng.fill_bytes(&mut buf);
4757 let mut unstructured = Unstructured::new(&buf);
4758 Self::arbitrary(&mut unstructured).unwrap_or_default()
4759 }
4760}
4761impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4762 fn default() -> Self {
4763 Self::DEFAULT.clone()
4764 }
4765}
4766impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4767 type Message = MavMessage;
4768 const ID: u32 = 140u32;
4769 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4770 const EXTRA_CRC: u8 = 181u8;
4771 const ENCODED_LEN: usize = 41usize;
4772 fn deser(
4773 _version: MavlinkVersion,
4774 __input: &[u8],
4775 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4776 let avail_len = __input.len();
4777 let mut payload_buf = [0; Self::ENCODED_LEN];
4778 let mut buf = if avail_len < Self::ENCODED_LEN {
4779 payload_buf[0..avail_len].copy_from_slice(__input);
4780 Bytes::new(&payload_buf)
4781 } else {
4782 Bytes::new(__input)
4783 };
4784 let mut __struct = Self::default();
4785 __struct.time_usec = buf.get_u64_le();
4786 for v in &mut __struct.controls {
4787 let val = buf.get_f32_le();
4788 *v = val;
4789 }
4790 __struct.group_mlx = buf.get_u8();
4791 Ok(__struct)
4792 }
4793 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4794 let mut __tmp = BytesMut::new(bytes);
4795 #[allow(clippy::absurd_extreme_comparisons)]
4796 #[allow(unused_comparisons)]
4797 if __tmp.remaining() < Self::ENCODED_LEN {
4798 panic!(
4799 "buffer is too small (need {} bytes, but got {})",
4800 Self::ENCODED_LEN,
4801 __tmp.remaining(),
4802 )
4803 }
4804 __tmp.put_u64_le(self.time_usec);
4805 for val in &self.controls {
4806 __tmp.put_f32_le(*val);
4807 }
4808 __tmp.put_u8(self.group_mlx);
4809 if matches!(version, MavlinkVersion::V2) {
4810 let len = __tmp.len();
4811 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4812 } else {
4813 __tmp.len()
4814 }
4815 }
4816}
4817#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4818#[doc = ""]
4819#[doc = "ID: 375"]
4820#[derive(Debug, Clone, PartialEq)]
4821#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4822#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4823#[cfg_attr(feature = "ts", derive(TS))]
4824#[cfg_attr(feature = "ts", ts(export))]
4825pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4826 #[doc = "Timestamp (since system boot)."]
4827 pub time_usec: u64,
4828 #[doc = "Active outputs"]
4829 pub active: u32,
4830 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4831 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4832 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4833 pub actuator: [f32; 32],
4834}
4835impl ACTUATOR_OUTPUT_STATUS_DATA {
4836 pub const ENCODED_LEN: usize = 140usize;
4837 pub const DEFAULT: Self = Self {
4838 time_usec: 0_u64,
4839 active: 0_u32,
4840 actuator: [0.0_f32; 32usize],
4841 };
4842 #[cfg(feature = "arbitrary")]
4843 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4844 use arbitrary::{Arbitrary, Unstructured};
4845 let mut buf = [0u8; 1024];
4846 rng.fill_bytes(&mut buf);
4847 let mut unstructured = Unstructured::new(&buf);
4848 Self::arbitrary(&mut unstructured).unwrap_or_default()
4849 }
4850}
4851impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4852 fn default() -> Self {
4853 Self::DEFAULT.clone()
4854 }
4855}
4856impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4857 type Message = MavMessage;
4858 const ID: u32 = 375u32;
4859 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4860 const EXTRA_CRC: u8 = 251u8;
4861 const ENCODED_LEN: usize = 140usize;
4862 fn deser(
4863 _version: MavlinkVersion,
4864 __input: &[u8],
4865 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4866 let avail_len = __input.len();
4867 let mut payload_buf = [0; Self::ENCODED_LEN];
4868 let mut buf = if avail_len < Self::ENCODED_LEN {
4869 payload_buf[0..avail_len].copy_from_slice(__input);
4870 Bytes::new(&payload_buf)
4871 } else {
4872 Bytes::new(__input)
4873 };
4874 let mut __struct = Self::default();
4875 __struct.time_usec = buf.get_u64_le();
4876 __struct.active = buf.get_u32_le();
4877 for v in &mut __struct.actuator {
4878 let val = buf.get_f32_le();
4879 *v = val;
4880 }
4881 Ok(__struct)
4882 }
4883 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4884 let mut __tmp = BytesMut::new(bytes);
4885 #[allow(clippy::absurd_extreme_comparisons)]
4886 #[allow(unused_comparisons)]
4887 if __tmp.remaining() < Self::ENCODED_LEN {
4888 panic!(
4889 "buffer is too small (need {} bytes, but got {})",
4890 Self::ENCODED_LEN,
4891 __tmp.remaining(),
4892 )
4893 }
4894 __tmp.put_u64_le(self.time_usec);
4895 __tmp.put_u32_le(self.active);
4896 for val in &self.actuator {
4897 __tmp.put_f32_le(*val);
4898 }
4899 if matches!(version, MavlinkVersion::V2) {
4900 let len = __tmp.len();
4901 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4902 } else {
4903 __tmp.len()
4904 }
4905 }
4906}
4907#[doc = "The location and information of an ADSB vehicle."]
4908#[doc = ""]
4909#[doc = "ID: 246"]
4910#[derive(Debug, Clone, PartialEq)]
4911#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4912#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4913#[cfg_attr(feature = "ts", derive(TS))]
4914#[cfg_attr(feature = "ts", ts(export))]
4915pub struct ADSB_VEHICLE_DATA {
4916 #[doc = "ICAO address"]
4917 pub ICAO_address: u32,
4918 #[doc = "Latitude"]
4919 pub lat: i32,
4920 #[doc = "Longitude"]
4921 pub lon: i32,
4922 #[doc = "Altitude(ASL)"]
4923 pub altitude: i32,
4924 #[doc = "Course over ground"]
4925 pub heading: u16,
4926 #[doc = "The horizontal velocity"]
4927 pub hor_velocity: u16,
4928 #[doc = "The vertical velocity. Positive is up"]
4929 pub ver_velocity: i16,
4930 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4931 pub flags: AdsbFlags,
4932 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4933 pub squawk: u16,
4934 #[doc = "ADSB altitude type."]
4935 pub altitude_type: AdsbAltitudeType,
4936 #[doc = "The callsign, 8+null"]
4937 #[cfg_attr(feature = "ts", ts(type = "string"))]
4938 pub callsign: CharArray<9>,
4939 #[doc = "ADSB emitter type."]
4940 pub emitter_type: AdsbEmitterType,
4941 #[doc = "Time since last communication in seconds"]
4942 pub tslc: u8,
4943}
4944impl ADSB_VEHICLE_DATA {
4945 pub const ENCODED_LEN: usize = 38usize;
4946 pub const DEFAULT: Self = Self {
4947 ICAO_address: 0_u32,
4948 lat: 0_i32,
4949 lon: 0_i32,
4950 altitude: 0_i32,
4951 heading: 0_u16,
4952 hor_velocity: 0_u16,
4953 ver_velocity: 0_i16,
4954 flags: AdsbFlags::DEFAULT,
4955 squawk: 0_u16,
4956 altitude_type: AdsbAltitudeType::DEFAULT,
4957 callsign: CharArray::new([0_u8; 9usize]),
4958 emitter_type: AdsbEmitterType::DEFAULT,
4959 tslc: 0_u8,
4960 };
4961 #[cfg(feature = "arbitrary")]
4962 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4963 use arbitrary::{Arbitrary, Unstructured};
4964 let mut buf = [0u8; 1024];
4965 rng.fill_bytes(&mut buf);
4966 let mut unstructured = Unstructured::new(&buf);
4967 Self::arbitrary(&mut unstructured).unwrap_or_default()
4968 }
4969}
4970impl Default for ADSB_VEHICLE_DATA {
4971 fn default() -> Self {
4972 Self::DEFAULT.clone()
4973 }
4974}
4975impl MessageData for ADSB_VEHICLE_DATA {
4976 type Message = MavMessage;
4977 const ID: u32 = 246u32;
4978 const NAME: &'static str = "ADSB_VEHICLE";
4979 const EXTRA_CRC: u8 = 184u8;
4980 const ENCODED_LEN: usize = 38usize;
4981 fn deser(
4982 _version: MavlinkVersion,
4983 __input: &[u8],
4984 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4985 let avail_len = __input.len();
4986 let mut payload_buf = [0; Self::ENCODED_LEN];
4987 let mut buf = if avail_len < Self::ENCODED_LEN {
4988 payload_buf[0..avail_len].copy_from_slice(__input);
4989 Bytes::new(&payload_buf)
4990 } else {
4991 Bytes::new(__input)
4992 };
4993 let mut __struct = Self::default();
4994 __struct.ICAO_address = buf.get_u32_le();
4995 __struct.lat = buf.get_i32_le();
4996 __struct.lon = buf.get_i32_le();
4997 __struct.altitude = buf.get_i32_le();
4998 __struct.heading = buf.get_u16_le();
4999 __struct.hor_velocity = buf.get_u16_le();
5000 __struct.ver_velocity = buf.get_i16_le();
5001 let tmp = buf.get_u16_le();
5002 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
5003 ::mavlink_core::error::ParserError::InvalidFlag {
5004 flag_type: "AdsbFlags",
5005 value: tmp as u32,
5006 },
5007 )?;
5008 __struct.squawk = buf.get_u16_le();
5009 let tmp = buf.get_u8();
5010 __struct.altitude_type =
5011 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5012 enum_type: "AdsbAltitudeType",
5013 value: tmp as u32,
5014 })?;
5015 let mut tmp = [0_u8; 9usize];
5016 for v in &mut tmp {
5017 *v = buf.get_u8();
5018 }
5019 __struct.callsign = CharArray::new(tmp);
5020 let tmp = buf.get_u8();
5021 __struct.emitter_type =
5022 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5023 enum_type: "AdsbEmitterType",
5024 value: tmp as u32,
5025 })?;
5026 __struct.tslc = buf.get_u8();
5027 Ok(__struct)
5028 }
5029 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5030 let mut __tmp = BytesMut::new(bytes);
5031 #[allow(clippy::absurd_extreme_comparisons)]
5032 #[allow(unused_comparisons)]
5033 if __tmp.remaining() < Self::ENCODED_LEN {
5034 panic!(
5035 "buffer is too small (need {} bytes, but got {})",
5036 Self::ENCODED_LEN,
5037 __tmp.remaining(),
5038 )
5039 }
5040 __tmp.put_u32_le(self.ICAO_address);
5041 __tmp.put_i32_le(self.lat);
5042 __tmp.put_i32_le(self.lon);
5043 __tmp.put_i32_le(self.altitude);
5044 __tmp.put_u16_le(self.heading);
5045 __tmp.put_u16_le(self.hor_velocity);
5046 __tmp.put_i16_le(self.ver_velocity);
5047 __tmp.put_u16_le(self.flags.bits());
5048 __tmp.put_u16_le(self.squawk);
5049 __tmp.put_u8(self.altitude_type as u8);
5050 for val in &self.callsign {
5051 __tmp.put_u8(*val);
5052 }
5053 __tmp.put_u8(self.emitter_type as u8);
5054 __tmp.put_u8(self.tslc);
5055 if matches!(version, MavlinkVersion::V2) {
5056 let len = __tmp.len();
5057 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5058 } else {
5059 __tmp.len()
5060 }
5061 }
5062}
5063#[doc = "The location and information of an AIS vessel."]
5064#[doc = ""]
5065#[doc = "ID: 301"]
5066#[derive(Debug, Clone, PartialEq)]
5067#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5068#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5069#[cfg_attr(feature = "ts", derive(TS))]
5070#[cfg_attr(feature = "ts", ts(export))]
5071pub struct AIS_VESSEL_DATA {
5072 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
5073 pub MMSI: u32,
5074 #[doc = "Latitude"]
5075 pub lat: i32,
5076 #[doc = "Longitude"]
5077 pub lon: i32,
5078 #[doc = "Course over ground"]
5079 pub COG: u16,
5080 #[doc = "True heading"]
5081 pub heading: u16,
5082 #[doc = "Speed over ground"]
5083 pub velocity: u16,
5084 #[doc = "Distance from lat/lon location to bow"]
5085 pub dimension_bow: u16,
5086 #[doc = "Distance from lat/lon location to stern"]
5087 pub dimension_stern: u16,
5088 #[doc = "Time since last communication in seconds"]
5089 pub tslc: u16,
5090 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5091 pub flags: AisFlags,
5092 #[doc = "Turn rate"]
5093 pub turn_rate: i8,
5094 #[doc = "Navigational status"]
5095 pub navigational_status: AisNavStatus,
5096 #[doc = "Type of vessels"]
5097 pub mavtype: AisType,
5098 #[doc = "Distance from lat/lon location to port side"]
5099 pub dimension_port: u8,
5100 #[doc = "Distance from lat/lon location to starboard side"]
5101 pub dimension_starboard: u8,
5102 #[doc = "The vessel callsign"]
5103 #[cfg_attr(feature = "ts", ts(type = "string"))]
5104 pub callsign: CharArray<7>,
5105 #[doc = "The vessel name"]
5106 #[cfg_attr(feature = "ts", ts(type = "string"))]
5107 pub name: CharArray<20>,
5108}
5109impl AIS_VESSEL_DATA {
5110 pub const ENCODED_LEN: usize = 58usize;
5111 pub const DEFAULT: Self = Self {
5112 MMSI: 0_u32,
5113 lat: 0_i32,
5114 lon: 0_i32,
5115 COG: 0_u16,
5116 heading: 0_u16,
5117 velocity: 0_u16,
5118 dimension_bow: 0_u16,
5119 dimension_stern: 0_u16,
5120 tslc: 0_u16,
5121 flags: AisFlags::DEFAULT,
5122 turn_rate: 0_i8,
5123 navigational_status: AisNavStatus::DEFAULT,
5124 mavtype: AisType::DEFAULT,
5125 dimension_port: 0_u8,
5126 dimension_starboard: 0_u8,
5127 callsign: CharArray::new([0_u8; 7usize]),
5128 name: CharArray::new([0_u8; 20usize]),
5129 };
5130 #[cfg(feature = "arbitrary")]
5131 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5132 use arbitrary::{Arbitrary, Unstructured};
5133 let mut buf = [0u8; 1024];
5134 rng.fill_bytes(&mut buf);
5135 let mut unstructured = Unstructured::new(&buf);
5136 Self::arbitrary(&mut unstructured).unwrap_or_default()
5137 }
5138}
5139impl Default for AIS_VESSEL_DATA {
5140 fn default() -> Self {
5141 Self::DEFAULT.clone()
5142 }
5143}
5144impl MessageData for AIS_VESSEL_DATA {
5145 type Message = MavMessage;
5146 const ID: u32 = 301u32;
5147 const NAME: &'static str = "AIS_VESSEL";
5148 const EXTRA_CRC: u8 = 243u8;
5149 const ENCODED_LEN: usize = 58usize;
5150 fn deser(
5151 _version: MavlinkVersion,
5152 __input: &[u8],
5153 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5154 let avail_len = __input.len();
5155 let mut payload_buf = [0; Self::ENCODED_LEN];
5156 let mut buf = if avail_len < Self::ENCODED_LEN {
5157 payload_buf[0..avail_len].copy_from_slice(__input);
5158 Bytes::new(&payload_buf)
5159 } else {
5160 Bytes::new(__input)
5161 };
5162 let mut __struct = Self::default();
5163 __struct.MMSI = buf.get_u32_le();
5164 __struct.lat = buf.get_i32_le();
5165 __struct.lon = buf.get_i32_le();
5166 __struct.COG = buf.get_u16_le();
5167 __struct.heading = buf.get_u16_le();
5168 __struct.velocity = buf.get_u16_le();
5169 __struct.dimension_bow = buf.get_u16_le();
5170 __struct.dimension_stern = buf.get_u16_le();
5171 __struct.tslc = buf.get_u16_le();
5172 let tmp = buf.get_u16_le();
5173 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
5174 ::mavlink_core::error::ParserError::InvalidFlag {
5175 flag_type: "AisFlags",
5176 value: tmp as u32,
5177 },
5178 )?;
5179 __struct.turn_rate = buf.get_i8();
5180 let tmp = buf.get_u8();
5181 __struct.navigational_status =
5182 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5183 enum_type: "AisNavStatus",
5184 value: tmp as u32,
5185 })?;
5186 let tmp = buf.get_u8();
5187 __struct.mavtype =
5188 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5189 enum_type: "AisType",
5190 value: tmp as u32,
5191 })?;
5192 __struct.dimension_port = buf.get_u8();
5193 __struct.dimension_starboard = buf.get_u8();
5194 let mut tmp = [0_u8; 7usize];
5195 for v in &mut tmp {
5196 *v = buf.get_u8();
5197 }
5198 __struct.callsign = CharArray::new(tmp);
5199 let mut tmp = [0_u8; 20usize];
5200 for v in &mut tmp {
5201 *v = buf.get_u8();
5202 }
5203 __struct.name = CharArray::new(tmp);
5204 Ok(__struct)
5205 }
5206 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5207 let mut __tmp = BytesMut::new(bytes);
5208 #[allow(clippy::absurd_extreme_comparisons)]
5209 #[allow(unused_comparisons)]
5210 if __tmp.remaining() < Self::ENCODED_LEN {
5211 panic!(
5212 "buffer is too small (need {} bytes, but got {})",
5213 Self::ENCODED_LEN,
5214 __tmp.remaining(),
5215 )
5216 }
5217 __tmp.put_u32_le(self.MMSI);
5218 __tmp.put_i32_le(self.lat);
5219 __tmp.put_i32_le(self.lon);
5220 __tmp.put_u16_le(self.COG);
5221 __tmp.put_u16_le(self.heading);
5222 __tmp.put_u16_le(self.velocity);
5223 __tmp.put_u16_le(self.dimension_bow);
5224 __tmp.put_u16_le(self.dimension_stern);
5225 __tmp.put_u16_le(self.tslc);
5226 __tmp.put_u16_le(self.flags.bits());
5227 __tmp.put_i8(self.turn_rate);
5228 __tmp.put_u8(self.navigational_status as u8);
5229 __tmp.put_u8(self.mavtype as u8);
5230 __tmp.put_u8(self.dimension_port);
5231 __tmp.put_u8(self.dimension_starboard);
5232 for val in &self.callsign {
5233 __tmp.put_u8(*val);
5234 }
5235 for val in &self.name {
5236 __tmp.put_u8(*val);
5237 }
5238 if matches!(version, MavlinkVersion::V2) {
5239 let len = __tmp.len();
5240 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5241 } else {
5242 __tmp.len()
5243 }
5244 }
5245}
5246#[doc = "The current system altitude."]
5247#[doc = ""]
5248#[doc = "ID: 141"]
5249#[derive(Debug, Clone, PartialEq)]
5250#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5251#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5252#[cfg_attr(feature = "ts", derive(TS))]
5253#[cfg_attr(feature = "ts", ts(export))]
5254pub struct ALTITUDE_DATA {
5255 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5256 pub time_usec: u64,
5257 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5258 pub altitude_monotonic: f32,
5259 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5260 pub altitude_amsl: f32,
5261 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5262 pub altitude_local: f32,
5263 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5264 pub altitude_relative: f32,
5265 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5266 pub altitude_terrain: f32,
5267 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5268 pub bottom_clearance: f32,
5269}
5270impl ALTITUDE_DATA {
5271 pub const ENCODED_LEN: usize = 32usize;
5272 pub const DEFAULT: Self = Self {
5273 time_usec: 0_u64,
5274 altitude_monotonic: 0.0_f32,
5275 altitude_amsl: 0.0_f32,
5276 altitude_local: 0.0_f32,
5277 altitude_relative: 0.0_f32,
5278 altitude_terrain: 0.0_f32,
5279 bottom_clearance: 0.0_f32,
5280 };
5281 #[cfg(feature = "arbitrary")]
5282 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5283 use arbitrary::{Arbitrary, Unstructured};
5284 let mut buf = [0u8; 1024];
5285 rng.fill_bytes(&mut buf);
5286 let mut unstructured = Unstructured::new(&buf);
5287 Self::arbitrary(&mut unstructured).unwrap_or_default()
5288 }
5289}
5290impl Default for ALTITUDE_DATA {
5291 fn default() -> Self {
5292 Self::DEFAULT.clone()
5293 }
5294}
5295impl MessageData for ALTITUDE_DATA {
5296 type Message = MavMessage;
5297 const ID: u32 = 141u32;
5298 const NAME: &'static str = "ALTITUDE";
5299 const EXTRA_CRC: u8 = 47u8;
5300 const ENCODED_LEN: usize = 32usize;
5301 fn deser(
5302 _version: MavlinkVersion,
5303 __input: &[u8],
5304 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5305 let avail_len = __input.len();
5306 let mut payload_buf = [0; Self::ENCODED_LEN];
5307 let mut buf = if avail_len < Self::ENCODED_LEN {
5308 payload_buf[0..avail_len].copy_from_slice(__input);
5309 Bytes::new(&payload_buf)
5310 } else {
5311 Bytes::new(__input)
5312 };
5313 let mut __struct = Self::default();
5314 __struct.time_usec = buf.get_u64_le();
5315 __struct.altitude_monotonic = buf.get_f32_le();
5316 __struct.altitude_amsl = buf.get_f32_le();
5317 __struct.altitude_local = buf.get_f32_le();
5318 __struct.altitude_relative = buf.get_f32_le();
5319 __struct.altitude_terrain = buf.get_f32_le();
5320 __struct.bottom_clearance = buf.get_f32_le();
5321 Ok(__struct)
5322 }
5323 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5324 let mut __tmp = BytesMut::new(bytes);
5325 #[allow(clippy::absurd_extreme_comparisons)]
5326 #[allow(unused_comparisons)]
5327 if __tmp.remaining() < Self::ENCODED_LEN {
5328 panic!(
5329 "buffer is too small (need {} bytes, but got {})",
5330 Self::ENCODED_LEN,
5331 __tmp.remaining(),
5332 )
5333 }
5334 __tmp.put_u64_le(self.time_usec);
5335 __tmp.put_f32_le(self.altitude_monotonic);
5336 __tmp.put_f32_le(self.altitude_amsl);
5337 __tmp.put_f32_le(self.altitude_local);
5338 __tmp.put_f32_le(self.altitude_relative);
5339 __tmp.put_f32_le(self.altitude_terrain);
5340 __tmp.put_f32_le(self.bottom_clearance);
5341 if matches!(version, MavlinkVersion::V2) {
5342 let len = __tmp.len();
5343 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5344 } else {
5345 __tmp.len()
5346 }
5347 }
5348}
5349#[doc = "ASL-fixed-wing controller data."]
5350#[doc = ""]
5351#[doc = "ID: 8004"]
5352#[derive(Debug, Clone, PartialEq)]
5353#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5355#[cfg_attr(feature = "ts", derive(TS))]
5356#[cfg_attr(feature = "ts", ts(export))]
5357pub struct ASLCTRL_DATA_DATA {
5358 #[doc = "Timestamp"]
5359 pub timestamp: u64,
5360 #[doc = "See sourcecode for a description of these values..."]
5361 pub h: f32,
5362 pub hRef: f32,
5363 pub hRef_t: f32,
5364 #[doc = "Pitch angle"]
5365 pub PitchAngle: f32,
5366 #[doc = "Pitch angle reference"]
5367 pub PitchAngleRef: f32,
5368 pub q: f32,
5369 pub qRef: f32,
5370 pub uElev: f32,
5371 pub uThrot: f32,
5372 pub uThrot2: f32,
5373 pub nZ: f32,
5374 #[doc = "Airspeed reference"]
5375 pub AirspeedRef: f32,
5376 #[doc = "Yaw angle"]
5377 pub YawAngle: f32,
5378 #[doc = "Yaw angle reference"]
5379 pub YawAngleRef: f32,
5380 #[doc = "Roll angle"]
5381 pub RollAngle: f32,
5382 #[doc = "Roll angle reference"]
5383 pub RollAngleRef: f32,
5384 pub p: f32,
5385 pub pRef: f32,
5386 pub r: f32,
5387 pub rRef: f32,
5388 pub uAil: f32,
5389 pub uRud: f32,
5390 #[doc = "ASLCTRL control-mode (manual, stabilized, auto, etc...)"]
5391 pub aslctrl_mode: u8,
5392 pub SpoilersEngaged: u8,
5393}
5394impl ASLCTRL_DATA_DATA {
5395 pub const ENCODED_LEN: usize = 98usize;
5396 pub const DEFAULT: Self = Self {
5397 timestamp: 0_u64,
5398 h: 0.0_f32,
5399 hRef: 0.0_f32,
5400 hRef_t: 0.0_f32,
5401 PitchAngle: 0.0_f32,
5402 PitchAngleRef: 0.0_f32,
5403 q: 0.0_f32,
5404 qRef: 0.0_f32,
5405 uElev: 0.0_f32,
5406 uThrot: 0.0_f32,
5407 uThrot2: 0.0_f32,
5408 nZ: 0.0_f32,
5409 AirspeedRef: 0.0_f32,
5410 YawAngle: 0.0_f32,
5411 YawAngleRef: 0.0_f32,
5412 RollAngle: 0.0_f32,
5413 RollAngleRef: 0.0_f32,
5414 p: 0.0_f32,
5415 pRef: 0.0_f32,
5416 r: 0.0_f32,
5417 rRef: 0.0_f32,
5418 uAil: 0.0_f32,
5419 uRud: 0.0_f32,
5420 aslctrl_mode: 0_u8,
5421 SpoilersEngaged: 0_u8,
5422 };
5423 #[cfg(feature = "arbitrary")]
5424 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5425 use arbitrary::{Arbitrary, Unstructured};
5426 let mut buf = [0u8; 1024];
5427 rng.fill_bytes(&mut buf);
5428 let mut unstructured = Unstructured::new(&buf);
5429 Self::arbitrary(&mut unstructured).unwrap_or_default()
5430 }
5431}
5432impl Default for ASLCTRL_DATA_DATA {
5433 fn default() -> Self {
5434 Self::DEFAULT.clone()
5435 }
5436}
5437impl MessageData for ASLCTRL_DATA_DATA {
5438 type Message = MavMessage;
5439 const ID: u32 = 8004u32;
5440 const NAME: &'static str = "ASLCTRL_DATA";
5441 const EXTRA_CRC: u8 = 172u8;
5442 const ENCODED_LEN: usize = 98usize;
5443 fn deser(
5444 _version: MavlinkVersion,
5445 __input: &[u8],
5446 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5447 let avail_len = __input.len();
5448 let mut payload_buf = [0; Self::ENCODED_LEN];
5449 let mut buf = if avail_len < Self::ENCODED_LEN {
5450 payload_buf[0..avail_len].copy_from_slice(__input);
5451 Bytes::new(&payload_buf)
5452 } else {
5453 Bytes::new(__input)
5454 };
5455 let mut __struct = Self::default();
5456 __struct.timestamp = buf.get_u64_le();
5457 __struct.h = buf.get_f32_le();
5458 __struct.hRef = buf.get_f32_le();
5459 __struct.hRef_t = buf.get_f32_le();
5460 __struct.PitchAngle = buf.get_f32_le();
5461 __struct.PitchAngleRef = buf.get_f32_le();
5462 __struct.q = buf.get_f32_le();
5463 __struct.qRef = buf.get_f32_le();
5464 __struct.uElev = buf.get_f32_le();
5465 __struct.uThrot = buf.get_f32_le();
5466 __struct.uThrot2 = buf.get_f32_le();
5467 __struct.nZ = buf.get_f32_le();
5468 __struct.AirspeedRef = buf.get_f32_le();
5469 __struct.YawAngle = buf.get_f32_le();
5470 __struct.YawAngleRef = buf.get_f32_le();
5471 __struct.RollAngle = buf.get_f32_le();
5472 __struct.RollAngleRef = buf.get_f32_le();
5473 __struct.p = buf.get_f32_le();
5474 __struct.pRef = buf.get_f32_le();
5475 __struct.r = buf.get_f32_le();
5476 __struct.rRef = buf.get_f32_le();
5477 __struct.uAil = buf.get_f32_le();
5478 __struct.uRud = buf.get_f32_le();
5479 __struct.aslctrl_mode = buf.get_u8();
5480 __struct.SpoilersEngaged = buf.get_u8();
5481 Ok(__struct)
5482 }
5483 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5484 let mut __tmp = BytesMut::new(bytes);
5485 #[allow(clippy::absurd_extreme_comparisons)]
5486 #[allow(unused_comparisons)]
5487 if __tmp.remaining() < Self::ENCODED_LEN {
5488 panic!(
5489 "buffer is too small (need {} bytes, but got {})",
5490 Self::ENCODED_LEN,
5491 __tmp.remaining(),
5492 )
5493 }
5494 __tmp.put_u64_le(self.timestamp);
5495 __tmp.put_f32_le(self.h);
5496 __tmp.put_f32_le(self.hRef);
5497 __tmp.put_f32_le(self.hRef_t);
5498 __tmp.put_f32_le(self.PitchAngle);
5499 __tmp.put_f32_le(self.PitchAngleRef);
5500 __tmp.put_f32_le(self.q);
5501 __tmp.put_f32_le(self.qRef);
5502 __tmp.put_f32_le(self.uElev);
5503 __tmp.put_f32_le(self.uThrot);
5504 __tmp.put_f32_le(self.uThrot2);
5505 __tmp.put_f32_le(self.nZ);
5506 __tmp.put_f32_le(self.AirspeedRef);
5507 __tmp.put_f32_le(self.YawAngle);
5508 __tmp.put_f32_le(self.YawAngleRef);
5509 __tmp.put_f32_le(self.RollAngle);
5510 __tmp.put_f32_le(self.RollAngleRef);
5511 __tmp.put_f32_le(self.p);
5512 __tmp.put_f32_le(self.pRef);
5513 __tmp.put_f32_le(self.r);
5514 __tmp.put_f32_le(self.rRef);
5515 __tmp.put_f32_le(self.uAil);
5516 __tmp.put_f32_le(self.uRud);
5517 __tmp.put_u8(self.aslctrl_mode);
5518 __tmp.put_u8(self.SpoilersEngaged);
5519 if matches!(version, MavlinkVersion::V2) {
5520 let len = __tmp.len();
5521 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5522 } else {
5523 __tmp.len()
5524 }
5525 }
5526}
5527#[doc = "ASL-fixed-wing controller debug data."]
5528#[doc = ""]
5529#[doc = "ID: 8005"]
5530#[derive(Debug, Clone, PartialEq)]
5531#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5533#[cfg_attr(feature = "ts", derive(TS))]
5534#[cfg_attr(feature = "ts", ts(export))]
5535pub struct ASLCTRL_DEBUG_DATA {
5536 #[doc = "Debug data"]
5537 pub i32_1: u32,
5538 #[doc = "Debug data"]
5539 pub f_1: f32,
5540 #[doc = "Debug data"]
5541 pub f_2: f32,
5542 #[doc = "Debug data"]
5543 pub f_3: f32,
5544 #[doc = "Debug data"]
5545 pub f_4: f32,
5546 #[doc = "Debug data"]
5547 pub f_5: f32,
5548 #[doc = "Debug data"]
5549 pub f_6: f32,
5550 #[doc = "Debug data"]
5551 pub f_7: f32,
5552 #[doc = "Debug data"]
5553 pub f_8: f32,
5554 #[doc = "Debug data"]
5555 pub i8_1: u8,
5556 #[doc = "Debug data"]
5557 pub i8_2: u8,
5558}
5559impl ASLCTRL_DEBUG_DATA {
5560 pub const ENCODED_LEN: usize = 38usize;
5561 pub const DEFAULT: Self = Self {
5562 i32_1: 0_u32,
5563 f_1: 0.0_f32,
5564 f_2: 0.0_f32,
5565 f_3: 0.0_f32,
5566 f_4: 0.0_f32,
5567 f_5: 0.0_f32,
5568 f_6: 0.0_f32,
5569 f_7: 0.0_f32,
5570 f_8: 0.0_f32,
5571 i8_1: 0_u8,
5572 i8_2: 0_u8,
5573 };
5574 #[cfg(feature = "arbitrary")]
5575 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5576 use arbitrary::{Arbitrary, Unstructured};
5577 let mut buf = [0u8; 1024];
5578 rng.fill_bytes(&mut buf);
5579 let mut unstructured = Unstructured::new(&buf);
5580 Self::arbitrary(&mut unstructured).unwrap_or_default()
5581 }
5582}
5583impl Default for ASLCTRL_DEBUG_DATA {
5584 fn default() -> Self {
5585 Self::DEFAULT.clone()
5586 }
5587}
5588impl MessageData for ASLCTRL_DEBUG_DATA {
5589 type Message = MavMessage;
5590 const ID: u32 = 8005u32;
5591 const NAME: &'static str = "ASLCTRL_DEBUG";
5592 const EXTRA_CRC: u8 = 251u8;
5593 const ENCODED_LEN: usize = 38usize;
5594 fn deser(
5595 _version: MavlinkVersion,
5596 __input: &[u8],
5597 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5598 let avail_len = __input.len();
5599 let mut payload_buf = [0; Self::ENCODED_LEN];
5600 let mut buf = if avail_len < Self::ENCODED_LEN {
5601 payload_buf[0..avail_len].copy_from_slice(__input);
5602 Bytes::new(&payload_buf)
5603 } else {
5604 Bytes::new(__input)
5605 };
5606 let mut __struct = Self::default();
5607 __struct.i32_1 = buf.get_u32_le();
5608 __struct.f_1 = buf.get_f32_le();
5609 __struct.f_2 = buf.get_f32_le();
5610 __struct.f_3 = buf.get_f32_le();
5611 __struct.f_4 = buf.get_f32_le();
5612 __struct.f_5 = buf.get_f32_le();
5613 __struct.f_6 = buf.get_f32_le();
5614 __struct.f_7 = buf.get_f32_le();
5615 __struct.f_8 = buf.get_f32_le();
5616 __struct.i8_1 = buf.get_u8();
5617 __struct.i8_2 = buf.get_u8();
5618 Ok(__struct)
5619 }
5620 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5621 let mut __tmp = BytesMut::new(bytes);
5622 #[allow(clippy::absurd_extreme_comparisons)]
5623 #[allow(unused_comparisons)]
5624 if __tmp.remaining() < Self::ENCODED_LEN {
5625 panic!(
5626 "buffer is too small (need {} bytes, but got {})",
5627 Self::ENCODED_LEN,
5628 __tmp.remaining(),
5629 )
5630 }
5631 __tmp.put_u32_le(self.i32_1);
5632 __tmp.put_f32_le(self.f_1);
5633 __tmp.put_f32_le(self.f_2);
5634 __tmp.put_f32_le(self.f_3);
5635 __tmp.put_f32_le(self.f_4);
5636 __tmp.put_f32_le(self.f_5);
5637 __tmp.put_f32_le(self.f_6);
5638 __tmp.put_f32_le(self.f_7);
5639 __tmp.put_f32_le(self.f_8);
5640 __tmp.put_u8(self.i8_1);
5641 __tmp.put_u8(self.i8_2);
5642 if matches!(version, MavlinkVersion::V2) {
5643 let len = __tmp.len();
5644 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5645 } else {
5646 __tmp.len()
5647 }
5648 }
5649}
5650#[doc = "Extended state information for ASLUAVs."]
5651#[doc = ""]
5652#[doc = "ID: 8006"]
5653#[derive(Debug, Clone, PartialEq)]
5654#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5655#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5656#[cfg_attr(feature = "ts", derive(TS))]
5657#[cfg_attr(feature = "ts", ts(export))]
5658pub struct ASLUAV_STATUS_DATA {
5659 #[doc = "Motor RPM"]
5660 pub Motor_rpm: f32,
5661 #[doc = "Status of the position-indicator LEDs"]
5662 pub LED_status: u8,
5663 #[doc = "Status of the IRIDIUM satellite communication system"]
5664 pub SATCOM_status: u8,
5665 #[doc = "Status vector for up to 8 servos"]
5666 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5667 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5668 pub Servo_status: [u8; 8],
5669}
5670impl ASLUAV_STATUS_DATA {
5671 pub const ENCODED_LEN: usize = 14usize;
5672 pub const DEFAULT: Self = Self {
5673 Motor_rpm: 0.0_f32,
5674 LED_status: 0_u8,
5675 SATCOM_status: 0_u8,
5676 Servo_status: [0_u8; 8usize],
5677 };
5678 #[cfg(feature = "arbitrary")]
5679 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5680 use arbitrary::{Arbitrary, Unstructured};
5681 let mut buf = [0u8; 1024];
5682 rng.fill_bytes(&mut buf);
5683 let mut unstructured = Unstructured::new(&buf);
5684 Self::arbitrary(&mut unstructured).unwrap_or_default()
5685 }
5686}
5687impl Default for ASLUAV_STATUS_DATA {
5688 fn default() -> Self {
5689 Self::DEFAULT.clone()
5690 }
5691}
5692impl MessageData for ASLUAV_STATUS_DATA {
5693 type Message = MavMessage;
5694 const ID: u32 = 8006u32;
5695 const NAME: &'static str = "ASLUAV_STATUS";
5696 const EXTRA_CRC: u8 = 97u8;
5697 const ENCODED_LEN: usize = 14usize;
5698 fn deser(
5699 _version: MavlinkVersion,
5700 __input: &[u8],
5701 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5702 let avail_len = __input.len();
5703 let mut payload_buf = [0; Self::ENCODED_LEN];
5704 let mut buf = if avail_len < Self::ENCODED_LEN {
5705 payload_buf[0..avail_len].copy_from_slice(__input);
5706 Bytes::new(&payload_buf)
5707 } else {
5708 Bytes::new(__input)
5709 };
5710 let mut __struct = Self::default();
5711 __struct.Motor_rpm = buf.get_f32_le();
5712 __struct.LED_status = buf.get_u8();
5713 __struct.SATCOM_status = buf.get_u8();
5714 for v in &mut __struct.Servo_status {
5715 let val = buf.get_u8();
5716 *v = val;
5717 }
5718 Ok(__struct)
5719 }
5720 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5721 let mut __tmp = BytesMut::new(bytes);
5722 #[allow(clippy::absurd_extreme_comparisons)]
5723 #[allow(unused_comparisons)]
5724 if __tmp.remaining() < Self::ENCODED_LEN {
5725 panic!(
5726 "buffer is too small (need {} bytes, but got {})",
5727 Self::ENCODED_LEN,
5728 __tmp.remaining(),
5729 )
5730 }
5731 __tmp.put_f32_le(self.Motor_rpm);
5732 __tmp.put_u8(self.LED_status);
5733 __tmp.put_u8(self.SATCOM_status);
5734 for val in &self.Servo_status {
5735 __tmp.put_u8(*val);
5736 }
5737 if matches!(version, MavlinkVersion::V2) {
5738 let len = __tmp.len();
5739 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5740 } else {
5741 __tmp.len()
5742 }
5743 }
5744}
5745#[doc = "Off-board controls/commands for ASLUAVs."]
5746#[doc = ""]
5747#[doc = "ID: 8008"]
5748#[derive(Debug, Clone, PartialEq)]
5749#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5750#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5751#[cfg_attr(feature = "ts", derive(TS))]
5752#[cfg_attr(feature = "ts", ts(export))]
5753pub struct ASL_OBCTRL_DATA {
5754 #[doc = "Time since system start"]
5755 pub timestamp: u64,
5756 #[doc = "Elevator command [~]"]
5757 pub uElev: f32,
5758 #[doc = "Throttle command [~]"]
5759 pub uThrot: f32,
5760 #[doc = "Throttle 2 command [~]"]
5761 pub uThrot2: f32,
5762 #[doc = "Left aileron command [~]"]
5763 pub uAilL: f32,
5764 #[doc = "Right aileron command [~]"]
5765 pub uAilR: f32,
5766 #[doc = "Rudder command [~]"]
5767 pub uRud: f32,
5768 #[doc = "Off-board computer status"]
5769 pub obctrl_status: u8,
5770}
5771impl ASL_OBCTRL_DATA {
5772 pub const ENCODED_LEN: usize = 33usize;
5773 pub const DEFAULT: Self = Self {
5774 timestamp: 0_u64,
5775 uElev: 0.0_f32,
5776 uThrot: 0.0_f32,
5777 uThrot2: 0.0_f32,
5778 uAilL: 0.0_f32,
5779 uAilR: 0.0_f32,
5780 uRud: 0.0_f32,
5781 obctrl_status: 0_u8,
5782 };
5783 #[cfg(feature = "arbitrary")]
5784 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5785 use arbitrary::{Arbitrary, Unstructured};
5786 let mut buf = [0u8; 1024];
5787 rng.fill_bytes(&mut buf);
5788 let mut unstructured = Unstructured::new(&buf);
5789 Self::arbitrary(&mut unstructured).unwrap_or_default()
5790 }
5791}
5792impl Default for ASL_OBCTRL_DATA {
5793 fn default() -> Self {
5794 Self::DEFAULT.clone()
5795 }
5796}
5797impl MessageData for ASL_OBCTRL_DATA {
5798 type Message = MavMessage;
5799 const ID: u32 = 8008u32;
5800 const NAME: &'static str = "ASL_OBCTRL";
5801 const EXTRA_CRC: u8 = 234u8;
5802 const ENCODED_LEN: usize = 33usize;
5803 fn deser(
5804 _version: MavlinkVersion,
5805 __input: &[u8],
5806 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5807 let avail_len = __input.len();
5808 let mut payload_buf = [0; Self::ENCODED_LEN];
5809 let mut buf = if avail_len < Self::ENCODED_LEN {
5810 payload_buf[0..avail_len].copy_from_slice(__input);
5811 Bytes::new(&payload_buf)
5812 } else {
5813 Bytes::new(__input)
5814 };
5815 let mut __struct = Self::default();
5816 __struct.timestamp = buf.get_u64_le();
5817 __struct.uElev = buf.get_f32_le();
5818 __struct.uThrot = buf.get_f32_le();
5819 __struct.uThrot2 = buf.get_f32_le();
5820 __struct.uAilL = buf.get_f32_le();
5821 __struct.uAilR = buf.get_f32_le();
5822 __struct.uRud = buf.get_f32_le();
5823 __struct.obctrl_status = buf.get_u8();
5824 Ok(__struct)
5825 }
5826 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5827 let mut __tmp = BytesMut::new(bytes);
5828 #[allow(clippy::absurd_extreme_comparisons)]
5829 #[allow(unused_comparisons)]
5830 if __tmp.remaining() < Self::ENCODED_LEN {
5831 panic!(
5832 "buffer is too small (need {} bytes, but got {})",
5833 Self::ENCODED_LEN,
5834 __tmp.remaining(),
5835 )
5836 }
5837 __tmp.put_u64_le(self.timestamp);
5838 __tmp.put_f32_le(self.uElev);
5839 __tmp.put_f32_le(self.uThrot);
5840 __tmp.put_f32_le(self.uThrot2);
5841 __tmp.put_f32_le(self.uAilL);
5842 __tmp.put_f32_le(self.uAilR);
5843 __tmp.put_f32_le(self.uRud);
5844 __tmp.put_u8(self.obctrl_status);
5845 if matches!(version, MavlinkVersion::V2) {
5846 let len = __tmp.len();
5847 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5848 } else {
5849 __tmp.len()
5850 }
5851 }
5852}
5853#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5854#[doc = ""]
5855#[doc = "ID: 30"]
5856#[derive(Debug, Clone, PartialEq)]
5857#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5858#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5859#[cfg_attr(feature = "ts", derive(TS))]
5860#[cfg_attr(feature = "ts", ts(export))]
5861pub struct ATTITUDE_DATA {
5862 #[doc = "Timestamp (time since system boot)."]
5863 pub time_boot_ms: u32,
5864 #[doc = "Roll angle (-pi..+pi)"]
5865 pub roll: f32,
5866 #[doc = "Pitch angle (-pi..+pi)"]
5867 pub pitch: f32,
5868 #[doc = "Yaw angle (-pi..+pi)"]
5869 pub yaw: f32,
5870 #[doc = "Roll angular speed"]
5871 pub rollspeed: f32,
5872 #[doc = "Pitch angular speed"]
5873 pub pitchspeed: f32,
5874 #[doc = "Yaw angular speed"]
5875 pub yawspeed: f32,
5876}
5877impl ATTITUDE_DATA {
5878 pub const ENCODED_LEN: usize = 28usize;
5879 pub const DEFAULT: Self = Self {
5880 time_boot_ms: 0_u32,
5881 roll: 0.0_f32,
5882 pitch: 0.0_f32,
5883 yaw: 0.0_f32,
5884 rollspeed: 0.0_f32,
5885 pitchspeed: 0.0_f32,
5886 yawspeed: 0.0_f32,
5887 };
5888 #[cfg(feature = "arbitrary")]
5889 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5890 use arbitrary::{Arbitrary, Unstructured};
5891 let mut buf = [0u8; 1024];
5892 rng.fill_bytes(&mut buf);
5893 let mut unstructured = Unstructured::new(&buf);
5894 Self::arbitrary(&mut unstructured).unwrap_or_default()
5895 }
5896}
5897impl Default for ATTITUDE_DATA {
5898 fn default() -> Self {
5899 Self::DEFAULT.clone()
5900 }
5901}
5902impl MessageData for ATTITUDE_DATA {
5903 type Message = MavMessage;
5904 const ID: u32 = 30u32;
5905 const NAME: &'static str = "ATTITUDE";
5906 const EXTRA_CRC: u8 = 39u8;
5907 const ENCODED_LEN: usize = 28usize;
5908 fn deser(
5909 _version: MavlinkVersion,
5910 __input: &[u8],
5911 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5912 let avail_len = __input.len();
5913 let mut payload_buf = [0; Self::ENCODED_LEN];
5914 let mut buf = if avail_len < Self::ENCODED_LEN {
5915 payload_buf[0..avail_len].copy_from_slice(__input);
5916 Bytes::new(&payload_buf)
5917 } else {
5918 Bytes::new(__input)
5919 };
5920 let mut __struct = Self::default();
5921 __struct.time_boot_ms = buf.get_u32_le();
5922 __struct.roll = buf.get_f32_le();
5923 __struct.pitch = buf.get_f32_le();
5924 __struct.yaw = buf.get_f32_le();
5925 __struct.rollspeed = buf.get_f32_le();
5926 __struct.pitchspeed = buf.get_f32_le();
5927 __struct.yawspeed = buf.get_f32_le();
5928 Ok(__struct)
5929 }
5930 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5931 let mut __tmp = BytesMut::new(bytes);
5932 #[allow(clippy::absurd_extreme_comparisons)]
5933 #[allow(unused_comparisons)]
5934 if __tmp.remaining() < Self::ENCODED_LEN {
5935 panic!(
5936 "buffer is too small (need {} bytes, but got {})",
5937 Self::ENCODED_LEN,
5938 __tmp.remaining(),
5939 )
5940 }
5941 __tmp.put_u32_le(self.time_boot_ms);
5942 __tmp.put_f32_le(self.roll);
5943 __tmp.put_f32_le(self.pitch);
5944 __tmp.put_f32_le(self.yaw);
5945 __tmp.put_f32_le(self.rollspeed);
5946 __tmp.put_f32_le(self.pitchspeed);
5947 __tmp.put_f32_le(self.yawspeed);
5948 if matches!(version, MavlinkVersion::V2) {
5949 let len = __tmp.len();
5950 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5951 } else {
5952 __tmp.len()
5953 }
5954 }
5955}
5956#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5957#[doc = ""]
5958#[doc = "ID: 31"]
5959#[derive(Debug, Clone, PartialEq)]
5960#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5961#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5962#[cfg_attr(feature = "ts", derive(TS))]
5963#[cfg_attr(feature = "ts", ts(export))]
5964pub struct ATTITUDE_QUATERNION_DATA {
5965 #[doc = "Timestamp (time since system boot)."]
5966 pub time_boot_ms: u32,
5967 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5968 pub q1: f32,
5969 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5970 pub q2: f32,
5971 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5972 pub q3: f32,
5973 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5974 pub q4: f32,
5975 #[doc = "Roll angular speed"]
5976 pub rollspeed: f32,
5977 #[doc = "Pitch angular speed"]
5978 pub pitchspeed: f32,
5979 #[doc = "Yaw angular speed"]
5980 pub yawspeed: f32,
5981 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5982 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5983 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5984 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5985 pub repr_offset_q: [f32; 4],
5986}
5987impl ATTITUDE_QUATERNION_DATA {
5988 pub const ENCODED_LEN: usize = 48usize;
5989 pub const DEFAULT: Self = Self {
5990 time_boot_ms: 0_u32,
5991 q1: 0.0_f32,
5992 q2: 0.0_f32,
5993 q3: 0.0_f32,
5994 q4: 0.0_f32,
5995 rollspeed: 0.0_f32,
5996 pitchspeed: 0.0_f32,
5997 yawspeed: 0.0_f32,
5998 repr_offset_q: [0.0_f32; 4usize],
5999 };
6000 #[cfg(feature = "arbitrary")]
6001 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6002 use arbitrary::{Arbitrary, Unstructured};
6003 let mut buf = [0u8; 1024];
6004 rng.fill_bytes(&mut buf);
6005 let mut unstructured = Unstructured::new(&buf);
6006 Self::arbitrary(&mut unstructured).unwrap_or_default()
6007 }
6008}
6009impl Default for ATTITUDE_QUATERNION_DATA {
6010 fn default() -> Self {
6011 Self::DEFAULT.clone()
6012 }
6013}
6014impl MessageData for ATTITUDE_QUATERNION_DATA {
6015 type Message = MavMessage;
6016 const ID: u32 = 31u32;
6017 const NAME: &'static str = "ATTITUDE_QUATERNION";
6018 const EXTRA_CRC: u8 = 246u8;
6019 const ENCODED_LEN: usize = 48usize;
6020 fn deser(
6021 _version: MavlinkVersion,
6022 __input: &[u8],
6023 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6024 let avail_len = __input.len();
6025 let mut payload_buf = [0; Self::ENCODED_LEN];
6026 let mut buf = if avail_len < Self::ENCODED_LEN {
6027 payload_buf[0..avail_len].copy_from_slice(__input);
6028 Bytes::new(&payload_buf)
6029 } else {
6030 Bytes::new(__input)
6031 };
6032 let mut __struct = Self::default();
6033 __struct.time_boot_ms = buf.get_u32_le();
6034 __struct.q1 = buf.get_f32_le();
6035 __struct.q2 = buf.get_f32_le();
6036 __struct.q3 = buf.get_f32_le();
6037 __struct.q4 = buf.get_f32_le();
6038 __struct.rollspeed = buf.get_f32_le();
6039 __struct.pitchspeed = buf.get_f32_le();
6040 __struct.yawspeed = buf.get_f32_le();
6041 for v in &mut __struct.repr_offset_q {
6042 let val = buf.get_f32_le();
6043 *v = val;
6044 }
6045 Ok(__struct)
6046 }
6047 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6048 let mut __tmp = BytesMut::new(bytes);
6049 #[allow(clippy::absurd_extreme_comparisons)]
6050 #[allow(unused_comparisons)]
6051 if __tmp.remaining() < Self::ENCODED_LEN {
6052 panic!(
6053 "buffer is too small (need {} bytes, but got {})",
6054 Self::ENCODED_LEN,
6055 __tmp.remaining(),
6056 )
6057 }
6058 __tmp.put_u32_le(self.time_boot_ms);
6059 __tmp.put_f32_le(self.q1);
6060 __tmp.put_f32_le(self.q2);
6061 __tmp.put_f32_le(self.q3);
6062 __tmp.put_f32_le(self.q4);
6063 __tmp.put_f32_le(self.rollspeed);
6064 __tmp.put_f32_le(self.pitchspeed);
6065 __tmp.put_f32_le(self.yawspeed);
6066 if matches!(version, MavlinkVersion::V2) {
6067 for val in &self.repr_offset_q {
6068 __tmp.put_f32_le(*val);
6069 }
6070 let len = __tmp.len();
6071 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6072 } else {
6073 __tmp.len()
6074 }
6075 }
6076}
6077#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
6078#[doc = ""]
6079#[doc = "ID: 61"]
6080#[derive(Debug, Clone, PartialEq)]
6081#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6082#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6083#[cfg_attr(feature = "ts", derive(TS))]
6084#[cfg_attr(feature = "ts", ts(export))]
6085pub struct ATTITUDE_QUATERNION_COV_DATA {
6086 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
6087 pub time_usec: u64,
6088 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
6089 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6090 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6091 pub q: [f32; 4],
6092 #[doc = "Roll angular speed"]
6093 pub rollspeed: f32,
6094 #[doc = "Pitch angular speed"]
6095 pub pitchspeed: f32,
6096 #[doc = "Yaw angular speed"]
6097 pub yawspeed: f32,
6098 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
6099 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6100 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6101 pub covariance: [f32; 9],
6102}
6103impl ATTITUDE_QUATERNION_COV_DATA {
6104 pub const ENCODED_LEN: usize = 72usize;
6105 pub const DEFAULT: Self = Self {
6106 time_usec: 0_u64,
6107 q: [0.0_f32; 4usize],
6108 rollspeed: 0.0_f32,
6109 pitchspeed: 0.0_f32,
6110 yawspeed: 0.0_f32,
6111 covariance: [0.0_f32; 9usize],
6112 };
6113 #[cfg(feature = "arbitrary")]
6114 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6115 use arbitrary::{Arbitrary, Unstructured};
6116 let mut buf = [0u8; 1024];
6117 rng.fill_bytes(&mut buf);
6118 let mut unstructured = Unstructured::new(&buf);
6119 Self::arbitrary(&mut unstructured).unwrap_or_default()
6120 }
6121}
6122impl Default for ATTITUDE_QUATERNION_COV_DATA {
6123 fn default() -> Self {
6124 Self::DEFAULT.clone()
6125 }
6126}
6127impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
6128 type Message = MavMessage;
6129 const ID: u32 = 61u32;
6130 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
6131 const EXTRA_CRC: u8 = 167u8;
6132 const ENCODED_LEN: usize = 72usize;
6133 fn deser(
6134 _version: MavlinkVersion,
6135 __input: &[u8],
6136 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6137 let avail_len = __input.len();
6138 let mut payload_buf = [0; Self::ENCODED_LEN];
6139 let mut buf = if avail_len < Self::ENCODED_LEN {
6140 payload_buf[0..avail_len].copy_from_slice(__input);
6141 Bytes::new(&payload_buf)
6142 } else {
6143 Bytes::new(__input)
6144 };
6145 let mut __struct = Self::default();
6146 __struct.time_usec = buf.get_u64_le();
6147 for v in &mut __struct.q {
6148 let val = buf.get_f32_le();
6149 *v = val;
6150 }
6151 __struct.rollspeed = buf.get_f32_le();
6152 __struct.pitchspeed = buf.get_f32_le();
6153 __struct.yawspeed = buf.get_f32_le();
6154 for v in &mut __struct.covariance {
6155 let val = buf.get_f32_le();
6156 *v = val;
6157 }
6158 Ok(__struct)
6159 }
6160 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6161 let mut __tmp = BytesMut::new(bytes);
6162 #[allow(clippy::absurd_extreme_comparisons)]
6163 #[allow(unused_comparisons)]
6164 if __tmp.remaining() < Self::ENCODED_LEN {
6165 panic!(
6166 "buffer is too small (need {} bytes, but got {})",
6167 Self::ENCODED_LEN,
6168 __tmp.remaining(),
6169 )
6170 }
6171 __tmp.put_u64_le(self.time_usec);
6172 for val in &self.q {
6173 __tmp.put_f32_le(*val);
6174 }
6175 __tmp.put_f32_le(self.rollspeed);
6176 __tmp.put_f32_le(self.pitchspeed);
6177 __tmp.put_f32_le(self.yawspeed);
6178 for val in &self.covariance {
6179 __tmp.put_f32_le(*val);
6180 }
6181 if matches!(version, MavlinkVersion::V2) {
6182 let len = __tmp.len();
6183 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6184 } else {
6185 __tmp.len()
6186 }
6187 }
6188}
6189#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
6190#[doc = ""]
6191#[doc = "ID: 83"]
6192#[derive(Debug, Clone, PartialEq)]
6193#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6194#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6195#[cfg_attr(feature = "ts", derive(TS))]
6196#[cfg_attr(feature = "ts", ts(export))]
6197pub struct ATTITUDE_TARGET_DATA {
6198 #[doc = "Timestamp (time since system boot)."]
6199 pub time_boot_ms: u32,
6200 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6201 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6202 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6203 pub q: [f32; 4],
6204 #[doc = "Body roll rate"]
6205 pub body_roll_rate: f32,
6206 #[doc = "Body pitch rate"]
6207 pub body_pitch_rate: f32,
6208 #[doc = "Body yaw rate"]
6209 pub body_yaw_rate: f32,
6210 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
6211 pub thrust: f32,
6212 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
6213 pub type_mask: AttitudeTargetTypemask,
6214}
6215impl ATTITUDE_TARGET_DATA {
6216 pub const ENCODED_LEN: usize = 37usize;
6217 pub const DEFAULT: Self = Self {
6218 time_boot_ms: 0_u32,
6219 q: [0.0_f32; 4usize],
6220 body_roll_rate: 0.0_f32,
6221 body_pitch_rate: 0.0_f32,
6222 body_yaw_rate: 0.0_f32,
6223 thrust: 0.0_f32,
6224 type_mask: AttitudeTargetTypemask::DEFAULT,
6225 };
6226 #[cfg(feature = "arbitrary")]
6227 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6228 use arbitrary::{Arbitrary, Unstructured};
6229 let mut buf = [0u8; 1024];
6230 rng.fill_bytes(&mut buf);
6231 let mut unstructured = Unstructured::new(&buf);
6232 Self::arbitrary(&mut unstructured).unwrap_or_default()
6233 }
6234}
6235impl Default for ATTITUDE_TARGET_DATA {
6236 fn default() -> Self {
6237 Self::DEFAULT.clone()
6238 }
6239}
6240impl MessageData for ATTITUDE_TARGET_DATA {
6241 type Message = MavMessage;
6242 const ID: u32 = 83u32;
6243 const NAME: &'static str = "ATTITUDE_TARGET";
6244 const EXTRA_CRC: u8 = 22u8;
6245 const ENCODED_LEN: usize = 37usize;
6246 fn deser(
6247 _version: MavlinkVersion,
6248 __input: &[u8],
6249 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6250 let avail_len = __input.len();
6251 let mut payload_buf = [0; Self::ENCODED_LEN];
6252 let mut buf = if avail_len < Self::ENCODED_LEN {
6253 payload_buf[0..avail_len].copy_from_slice(__input);
6254 Bytes::new(&payload_buf)
6255 } else {
6256 Bytes::new(__input)
6257 };
6258 let mut __struct = Self::default();
6259 __struct.time_boot_ms = buf.get_u32_le();
6260 for v in &mut __struct.q {
6261 let val = buf.get_f32_le();
6262 *v = val;
6263 }
6264 __struct.body_roll_rate = buf.get_f32_le();
6265 __struct.body_pitch_rate = buf.get_f32_le();
6266 __struct.body_yaw_rate = buf.get_f32_le();
6267 __struct.thrust = buf.get_f32_le();
6268 let tmp = buf.get_u8();
6269 __struct.type_mask = AttitudeTargetTypemask::from_bits(
6270 tmp & AttitudeTargetTypemask::all().bits(),
6271 )
6272 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6273 flag_type: "AttitudeTargetTypemask",
6274 value: tmp as u32,
6275 })?;
6276 Ok(__struct)
6277 }
6278 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6279 let mut __tmp = BytesMut::new(bytes);
6280 #[allow(clippy::absurd_extreme_comparisons)]
6281 #[allow(unused_comparisons)]
6282 if __tmp.remaining() < Self::ENCODED_LEN {
6283 panic!(
6284 "buffer is too small (need {} bytes, but got {})",
6285 Self::ENCODED_LEN,
6286 __tmp.remaining(),
6287 )
6288 }
6289 __tmp.put_u32_le(self.time_boot_ms);
6290 for val in &self.q {
6291 __tmp.put_f32_le(*val);
6292 }
6293 __tmp.put_f32_le(self.body_roll_rate);
6294 __tmp.put_f32_le(self.body_pitch_rate);
6295 __tmp.put_f32_le(self.body_yaw_rate);
6296 __tmp.put_f32_le(self.thrust);
6297 __tmp.put_u8(self.type_mask.bits());
6298 if matches!(version, MavlinkVersion::V2) {
6299 let len = __tmp.len();
6300 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6301 } else {
6302 __tmp.len()
6303 }
6304 }
6305}
6306#[doc = "Motion capture attitude and position."]
6307#[doc = ""]
6308#[doc = "ID: 138"]
6309#[derive(Debug, Clone, PartialEq)]
6310#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6311#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6312#[cfg_attr(feature = "ts", derive(TS))]
6313#[cfg_attr(feature = "ts", ts(export))]
6314pub struct ATT_POS_MOCAP_DATA {
6315 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
6316 pub time_usec: u64,
6317 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6318 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6319 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6320 pub q: [f32; 4],
6321 #[doc = "X position (NED)"]
6322 pub x: f32,
6323 #[doc = "Y position (NED)"]
6324 pub y: f32,
6325 #[doc = "Z position (NED)"]
6326 pub z: f32,
6327 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
6328 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6329 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6330 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6331 pub covariance: [f32; 21],
6332}
6333impl ATT_POS_MOCAP_DATA {
6334 pub const ENCODED_LEN: usize = 120usize;
6335 pub const DEFAULT: Self = Self {
6336 time_usec: 0_u64,
6337 q: [0.0_f32; 4usize],
6338 x: 0.0_f32,
6339 y: 0.0_f32,
6340 z: 0.0_f32,
6341 covariance: [0.0_f32; 21usize],
6342 };
6343 #[cfg(feature = "arbitrary")]
6344 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6345 use arbitrary::{Arbitrary, Unstructured};
6346 let mut buf = [0u8; 1024];
6347 rng.fill_bytes(&mut buf);
6348 let mut unstructured = Unstructured::new(&buf);
6349 Self::arbitrary(&mut unstructured).unwrap_or_default()
6350 }
6351}
6352impl Default for ATT_POS_MOCAP_DATA {
6353 fn default() -> Self {
6354 Self::DEFAULT.clone()
6355 }
6356}
6357impl MessageData for ATT_POS_MOCAP_DATA {
6358 type Message = MavMessage;
6359 const ID: u32 = 138u32;
6360 const NAME: &'static str = "ATT_POS_MOCAP";
6361 const EXTRA_CRC: u8 = 109u8;
6362 const ENCODED_LEN: usize = 120usize;
6363 fn deser(
6364 _version: MavlinkVersion,
6365 __input: &[u8],
6366 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6367 let avail_len = __input.len();
6368 let mut payload_buf = [0; Self::ENCODED_LEN];
6369 let mut buf = if avail_len < Self::ENCODED_LEN {
6370 payload_buf[0..avail_len].copy_from_slice(__input);
6371 Bytes::new(&payload_buf)
6372 } else {
6373 Bytes::new(__input)
6374 };
6375 let mut __struct = Self::default();
6376 __struct.time_usec = buf.get_u64_le();
6377 for v in &mut __struct.q {
6378 let val = buf.get_f32_le();
6379 *v = val;
6380 }
6381 __struct.x = buf.get_f32_le();
6382 __struct.y = buf.get_f32_le();
6383 __struct.z = buf.get_f32_le();
6384 for v in &mut __struct.covariance {
6385 let val = buf.get_f32_le();
6386 *v = val;
6387 }
6388 Ok(__struct)
6389 }
6390 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6391 let mut __tmp = BytesMut::new(bytes);
6392 #[allow(clippy::absurd_extreme_comparisons)]
6393 #[allow(unused_comparisons)]
6394 if __tmp.remaining() < Self::ENCODED_LEN {
6395 panic!(
6396 "buffer is too small (need {} bytes, but got {})",
6397 Self::ENCODED_LEN,
6398 __tmp.remaining(),
6399 )
6400 }
6401 __tmp.put_u64_le(self.time_usec);
6402 for val in &self.q {
6403 __tmp.put_f32_le(*val);
6404 }
6405 __tmp.put_f32_le(self.x);
6406 __tmp.put_f32_le(self.y);
6407 __tmp.put_f32_le(self.z);
6408 if matches!(version, MavlinkVersion::V2) {
6409 for val in &self.covariance {
6410 __tmp.put_f32_le(*val);
6411 }
6412 let len = __tmp.len();
6413 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6414 } else {
6415 __tmp.len()
6416 }
6417 }
6418}
6419#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
6420#[doc = ""]
6421#[doc = "ID: 7"]
6422#[derive(Debug, Clone, PartialEq)]
6423#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6424#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6425#[cfg_attr(feature = "ts", derive(TS))]
6426#[cfg_attr(feature = "ts", ts(export))]
6427pub struct AUTH_KEY_DATA {
6428 #[doc = "key"]
6429 #[cfg_attr(feature = "ts", ts(type = "string"))]
6430 pub key: CharArray<32>,
6431}
6432impl AUTH_KEY_DATA {
6433 pub const ENCODED_LEN: usize = 32usize;
6434 pub const DEFAULT: Self = Self {
6435 key: CharArray::new([0_u8; 32usize]),
6436 };
6437 #[cfg(feature = "arbitrary")]
6438 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6439 use arbitrary::{Arbitrary, Unstructured};
6440 let mut buf = [0u8; 1024];
6441 rng.fill_bytes(&mut buf);
6442 let mut unstructured = Unstructured::new(&buf);
6443 Self::arbitrary(&mut unstructured).unwrap_or_default()
6444 }
6445}
6446impl Default for AUTH_KEY_DATA {
6447 fn default() -> Self {
6448 Self::DEFAULT.clone()
6449 }
6450}
6451impl MessageData for AUTH_KEY_DATA {
6452 type Message = MavMessage;
6453 const ID: u32 = 7u32;
6454 const NAME: &'static str = "AUTH_KEY";
6455 const EXTRA_CRC: u8 = 119u8;
6456 const ENCODED_LEN: usize = 32usize;
6457 fn deser(
6458 _version: MavlinkVersion,
6459 __input: &[u8],
6460 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6461 let avail_len = __input.len();
6462 let mut payload_buf = [0; Self::ENCODED_LEN];
6463 let mut buf = if avail_len < Self::ENCODED_LEN {
6464 payload_buf[0..avail_len].copy_from_slice(__input);
6465 Bytes::new(&payload_buf)
6466 } else {
6467 Bytes::new(__input)
6468 };
6469 let mut __struct = Self::default();
6470 let mut tmp = [0_u8; 32usize];
6471 for v in &mut tmp {
6472 *v = buf.get_u8();
6473 }
6474 __struct.key = CharArray::new(tmp);
6475 Ok(__struct)
6476 }
6477 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6478 let mut __tmp = BytesMut::new(bytes);
6479 #[allow(clippy::absurd_extreme_comparisons)]
6480 #[allow(unused_comparisons)]
6481 if __tmp.remaining() < Self::ENCODED_LEN {
6482 panic!(
6483 "buffer is too small (need {} bytes, but got {})",
6484 Self::ENCODED_LEN,
6485 __tmp.remaining(),
6486 )
6487 }
6488 for val in &self.key {
6489 __tmp.put_u8(*val);
6490 }
6491 if matches!(version, MavlinkVersion::V2) {
6492 let len = __tmp.len();
6493 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6494 } else {
6495 __tmp.len()
6496 }
6497 }
6498}
6499#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
6500#[doc = ""]
6501#[doc = "ID: 286"]
6502#[derive(Debug, Clone, PartialEq)]
6503#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6504#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6505#[cfg_attr(feature = "ts", derive(TS))]
6506#[cfg_attr(feature = "ts", ts(export))]
6507pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6508 #[doc = "Timestamp (time since system boot)."]
6509 pub time_boot_us: u64,
6510 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
6511 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6512 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6513 pub q: [f32; 4],
6514 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
6515 pub q_estimated_delay_us: u32,
6516 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
6517 pub vx: f32,
6518 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
6519 pub vy: f32,
6520 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
6521 pub vz: f32,
6522 #[doc = "Estimated delay of the speed data. 0 if unknown."]
6523 pub v_estimated_delay_us: u32,
6524 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
6525 pub feed_forward_angular_velocity_z: f32,
6526 #[doc = "Bitmap indicating which estimator outputs are valid."]
6527 pub estimator_status: EstimatorStatusFlags,
6528 #[doc = "System ID"]
6529 pub target_system: u8,
6530 #[doc = "Component ID"]
6531 pub target_component: u8,
6532 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
6533 pub landed_state: MavLandedState,
6534 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
6535 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6536 pub angular_velocity_z: f32,
6537}
6538impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6539 pub const ENCODED_LEN: usize = 57usize;
6540 pub const DEFAULT: Self = Self {
6541 time_boot_us: 0_u64,
6542 q: [0.0_f32; 4usize],
6543 q_estimated_delay_us: 0_u32,
6544 vx: 0.0_f32,
6545 vy: 0.0_f32,
6546 vz: 0.0_f32,
6547 v_estimated_delay_us: 0_u32,
6548 feed_forward_angular_velocity_z: 0.0_f32,
6549 estimator_status: EstimatorStatusFlags::DEFAULT,
6550 target_system: 0_u8,
6551 target_component: 0_u8,
6552 landed_state: MavLandedState::DEFAULT,
6553 angular_velocity_z: 0.0_f32,
6554 };
6555 #[cfg(feature = "arbitrary")]
6556 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6557 use arbitrary::{Arbitrary, Unstructured};
6558 let mut buf = [0u8; 1024];
6559 rng.fill_bytes(&mut buf);
6560 let mut unstructured = Unstructured::new(&buf);
6561 Self::arbitrary(&mut unstructured).unwrap_or_default()
6562 }
6563}
6564impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6565 fn default() -> Self {
6566 Self::DEFAULT.clone()
6567 }
6568}
6569impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6570 type Message = MavMessage;
6571 const ID: u32 = 286u32;
6572 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6573 const EXTRA_CRC: u8 = 210u8;
6574 const ENCODED_LEN: usize = 57usize;
6575 fn deser(
6576 _version: MavlinkVersion,
6577 __input: &[u8],
6578 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6579 let avail_len = __input.len();
6580 let mut payload_buf = [0; Self::ENCODED_LEN];
6581 let mut buf = if avail_len < Self::ENCODED_LEN {
6582 payload_buf[0..avail_len].copy_from_slice(__input);
6583 Bytes::new(&payload_buf)
6584 } else {
6585 Bytes::new(__input)
6586 };
6587 let mut __struct = Self::default();
6588 __struct.time_boot_us = buf.get_u64_le();
6589 for v in &mut __struct.q {
6590 let val = buf.get_f32_le();
6591 *v = val;
6592 }
6593 __struct.q_estimated_delay_us = buf.get_u32_le();
6594 __struct.vx = buf.get_f32_le();
6595 __struct.vy = buf.get_f32_le();
6596 __struct.vz = buf.get_f32_le();
6597 __struct.v_estimated_delay_us = buf.get_u32_le();
6598 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
6599 let tmp = buf.get_u16_le();
6600 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6601 tmp & EstimatorStatusFlags::all().bits(),
6602 )
6603 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6604 flag_type: "EstimatorStatusFlags",
6605 value: tmp as u32,
6606 })?;
6607 __struct.target_system = buf.get_u8();
6608 __struct.target_component = buf.get_u8();
6609 let tmp = buf.get_u8();
6610 __struct.landed_state =
6611 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6612 enum_type: "MavLandedState",
6613 value: tmp as u32,
6614 })?;
6615 __struct.angular_velocity_z = buf.get_f32_le();
6616 Ok(__struct)
6617 }
6618 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6619 let mut __tmp = BytesMut::new(bytes);
6620 #[allow(clippy::absurd_extreme_comparisons)]
6621 #[allow(unused_comparisons)]
6622 if __tmp.remaining() < Self::ENCODED_LEN {
6623 panic!(
6624 "buffer is too small (need {} bytes, but got {})",
6625 Self::ENCODED_LEN,
6626 __tmp.remaining(),
6627 )
6628 }
6629 __tmp.put_u64_le(self.time_boot_us);
6630 for val in &self.q {
6631 __tmp.put_f32_le(*val);
6632 }
6633 __tmp.put_u32_le(self.q_estimated_delay_us);
6634 __tmp.put_f32_le(self.vx);
6635 __tmp.put_f32_le(self.vy);
6636 __tmp.put_f32_le(self.vz);
6637 __tmp.put_u32_le(self.v_estimated_delay_us);
6638 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6639 __tmp.put_u16_le(self.estimator_status.bits());
6640 __tmp.put_u8(self.target_system);
6641 __tmp.put_u8(self.target_component);
6642 __tmp.put_u8(self.landed_state as u8);
6643 if matches!(version, MavlinkVersion::V2) {
6644 __tmp.put_f32_le(self.angular_velocity_z);
6645 let len = __tmp.len();
6646 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6647 } else {
6648 __tmp.len()
6649 }
6650 }
6651}
6652#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6653#[doc = ""]
6654#[doc = "ID: 148"]
6655#[derive(Debug, Clone, PartialEq)]
6656#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6657#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6658#[cfg_attr(feature = "ts", derive(TS))]
6659#[cfg_attr(feature = "ts", ts(export))]
6660pub struct AUTOPILOT_VERSION_DATA {
6661 #[doc = "Bitmap of capabilities"]
6662 pub capabilities: MavProtocolCapability,
6663 #[doc = "UID if provided by hardware (see uid2)"]
6664 pub uid: u64,
6665 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6666 pub flight_sw_version: u32,
6667 #[doc = "Middleware version number"]
6668 pub middleware_sw_version: u32,
6669 #[doc = "Operating system version number"]
6670 pub os_sw_version: u32,
6671 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6672 pub board_version: u32,
6673 #[doc = "ID of the board vendor"]
6674 pub vendor_id: u16,
6675 #[doc = "ID of the product"]
6676 pub product_id: u16,
6677 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6678 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6679 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6680 pub flight_custom_version: [u8; 8],
6681 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6682 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6683 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6684 pub middleware_custom_version: [u8; 8],
6685 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6686 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6687 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6688 pub os_custom_version: [u8; 8],
6689 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6690 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6691 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6692 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6693 pub uid2: [u8; 18],
6694}
6695impl AUTOPILOT_VERSION_DATA {
6696 pub const ENCODED_LEN: usize = 78usize;
6697 pub const DEFAULT: Self = Self {
6698 capabilities: MavProtocolCapability::DEFAULT,
6699 uid: 0_u64,
6700 flight_sw_version: 0_u32,
6701 middleware_sw_version: 0_u32,
6702 os_sw_version: 0_u32,
6703 board_version: 0_u32,
6704 vendor_id: 0_u16,
6705 product_id: 0_u16,
6706 flight_custom_version: [0_u8; 8usize],
6707 middleware_custom_version: [0_u8; 8usize],
6708 os_custom_version: [0_u8; 8usize],
6709 uid2: [0_u8; 18usize],
6710 };
6711 #[cfg(feature = "arbitrary")]
6712 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6713 use arbitrary::{Arbitrary, Unstructured};
6714 let mut buf = [0u8; 1024];
6715 rng.fill_bytes(&mut buf);
6716 let mut unstructured = Unstructured::new(&buf);
6717 Self::arbitrary(&mut unstructured).unwrap_or_default()
6718 }
6719}
6720impl Default for AUTOPILOT_VERSION_DATA {
6721 fn default() -> Self {
6722 Self::DEFAULT.clone()
6723 }
6724}
6725impl MessageData for AUTOPILOT_VERSION_DATA {
6726 type Message = MavMessage;
6727 const ID: u32 = 148u32;
6728 const NAME: &'static str = "AUTOPILOT_VERSION";
6729 const EXTRA_CRC: u8 = 178u8;
6730 const ENCODED_LEN: usize = 78usize;
6731 fn deser(
6732 _version: MavlinkVersion,
6733 __input: &[u8],
6734 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6735 let avail_len = __input.len();
6736 let mut payload_buf = [0; Self::ENCODED_LEN];
6737 let mut buf = if avail_len < Self::ENCODED_LEN {
6738 payload_buf[0..avail_len].copy_from_slice(__input);
6739 Bytes::new(&payload_buf)
6740 } else {
6741 Bytes::new(__input)
6742 };
6743 let mut __struct = Self::default();
6744 let tmp = buf.get_u64_le();
6745 __struct.capabilities = MavProtocolCapability::from_bits(
6746 tmp & MavProtocolCapability::all().bits(),
6747 )
6748 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6749 flag_type: "MavProtocolCapability",
6750 value: tmp as u32,
6751 })?;
6752 __struct.uid = buf.get_u64_le();
6753 __struct.flight_sw_version = buf.get_u32_le();
6754 __struct.middleware_sw_version = buf.get_u32_le();
6755 __struct.os_sw_version = buf.get_u32_le();
6756 __struct.board_version = buf.get_u32_le();
6757 __struct.vendor_id = buf.get_u16_le();
6758 __struct.product_id = buf.get_u16_le();
6759 for v in &mut __struct.flight_custom_version {
6760 let val = buf.get_u8();
6761 *v = val;
6762 }
6763 for v in &mut __struct.middleware_custom_version {
6764 let val = buf.get_u8();
6765 *v = val;
6766 }
6767 for v in &mut __struct.os_custom_version {
6768 let val = buf.get_u8();
6769 *v = val;
6770 }
6771 for v in &mut __struct.uid2 {
6772 let val = buf.get_u8();
6773 *v = val;
6774 }
6775 Ok(__struct)
6776 }
6777 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6778 let mut __tmp = BytesMut::new(bytes);
6779 #[allow(clippy::absurd_extreme_comparisons)]
6780 #[allow(unused_comparisons)]
6781 if __tmp.remaining() < Self::ENCODED_LEN {
6782 panic!(
6783 "buffer is too small (need {} bytes, but got {})",
6784 Self::ENCODED_LEN,
6785 __tmp.remaining(),
6786 )
6787 }
6788 __tmp.put_u64_le(self.capabilities.bits());
6789 __tmp.put_u64_le(self.uid);
6790 __tmp.put_u32_le(self.flight_sw_version);
6791 __tmp.put_u32_le(self.middleware_sw_version);
6792 __tmp.put_u32_le(self.os_sw_version);
6793 __tmp.put_u32_le(self.board_version);
6794 __tmp.put_u16_le(self.vendor_id);
6795 __tmp.put_u16_le(self.product_id);
6796 for val in &self.flight_custom_version {
6797 __tmp.put_u8(*val);
6798 }
6799 for val in &self.middleware_custom_version {
6800 __tmp.put_u8(*val);
6801 }
6802 for val in &self.os_custom_version {
6803 __tmp.put_u8(*val);
6804 }
6805 if matches!(version, MavlinkVersion::V2) {
6806 for val in &self.uid2 {
6807 __tmp.put_u8(*val);
6808 }
6809 let len = __tmp.len();
6810 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6811 } else {
6812 __tmp.len()
6813 }
6814 }
6815}
6816#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6817#[doc = ""]
6818#[doc = "ID: 435"]
6819#[derive(Debug, Clone, PartialEq)]
6820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6821#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6822#[cfg_attr(feature = "ts", derive(TS))]
6823#[cfg_attr(feature = "ts", ts(export))]
6824pub struct AVAILABLE_MODES_DATA {
6825 #[doc = "A bitfield for use for autopilot-specific flags"]
6826 pub custom_mode: u32,
6827 #[doc = "Mode properties."]
6828 pub properties: MavModeProperty,
6829 #[doc = "The total number of available modes for the current vehicle type."]
6830 pub number_modes: u8,
6831 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6832 pub mode_index: u8,
6833 #[doc = "Standard mode."]
6834 pub standard_mode: MavStandardMode,
6835 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6836 #[cfg_attr(feature = "ts", ts(type = "string"))]
6837 pub mode_name: CharArray<35>,
6838}
6839impl AVAILABLE_MODES_DATA {
6840 pub const ENCODED_LEN: usize = 46usize;
6841 pub const DEFAULT: Self = Self {
6842 custom_mode: 0_u32,
6843 properties: MavModeProperty::DEFAULT,
6844 number_modes: 0_u8,
6845 mode_index: 0_u8,
6846 standard_mode: MavStandardMode::DEFAULT,
6847 mode_name: CharArray::new([0_u8; 35usize]),
6848 };
6849 #[cfg(feature = "arbitrary")]
6850 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6851 use arbitrary::{Arbitrary, Unstructured};
6852 let mut buf = [0u8; 1024];
6853 rng.fill_bytes(&mut buf);
6854 let mut unstructured = Unstructured::new(&buf);
6855 Self::arbitrary(&mut unstructured).unwrap_or_default()
6856 }
6857}
6858impl Default for AVAILABLE_MODES_DATA {
6859 fn default() -> Self {
6860 Self::DEFAULT.clone()
6861 }
6862}
6863impl MessageData for AVAILABLE_MODES_DATA {
6864 type Message = MavMessage;
6865 const ID: u32 = 435u32;
6866 const NAME: &'static str = "AVAILABLE_MODES";
6867 const EXTRA_CRC: u8 = 134u8;
6868 const ENCODED_LEN: usize = 46usize;
6869 fn deser(
6870 _version: MavlinkVersion,
6871 __input: &[u8],
6872 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6873 let avail_len = __input.len();
6874 let mut payload_buf = [0; Self::ENCODED_LEN];
6875 let mut buf = if avail_len < Self::ENCODED_LEN {
6876 payload_buf[0..avail_len].copy_from_slice(__input);
6877 Bytes::new(&payload_buf)
6878 } else {
6879 Bytes::new(__input)
6880 };
6881 let mut __struct = Self::default();
6882 __struct.custom_mode = buf.get_u32_le();
6883 let tmp = buf.get_u32_le();
6884 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6885 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6886 flag_type: "MavModeProperty",
6887 value: tmp as u32,
6888 })?;
6889 __struct.number_modes = buf.get_u8();
6890 __struct.mode_index = buf.get_u8();
6891 let tmp = buf.get_u8();
6892 __struct.standard_mode =
6893 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6894 enum_type: "MavStandardMode",
6895 value: tmp as u32,
6896 })?;
6897 let mut tmp = [0_u8; 35usize];
6898 for v in &mut tmp {
6899 *v = buf.get_u8();
6900 }
6901 __struct.mode_name = CharArray::new(tmp);
6902 Ok(__struct)
6903 }
6904 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6905 let mut __tmp = BytesMut::new(bytes);
6906 #[allow(clippy::absurd_extreme_comparisons)]
6907 #[allow(unused_comparisons)]
6908 if __tmp.remaining() < Self::ENCODED_LEN {
6909 panic!(
6910 "buffer is too small (need {} bytes, but got {})",
6911 Self::ENCODED_LEN,
6912 __tmp.remaining(),
6913 )
6914 }
6915 __tmp.put_u32_le(self.custom_mode);
6916 __tmp.put_u32_le(self.properties.bits());
6917 __tmp.put_u8(self.number_modes);
6918 __tmp.put_u8(self.mode_index);
6919 __tmp.put_u8(self.standard_mode as u8);
6920 for val in &self.mode_name {
6921 __tmp.put_u8(*val);
6922 }
6923 if matches!(version, MavlinkVersion::V2) {
6924 let len = __tmp.len();
6925 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6926 } else {
6927 __tmp.len()
6928 }
6929 }
6930}
6931#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6932#[doc = ""]
6933#[doc = "ID: 437"]
6934#[derive(Debug, Clone, PartialEq)]
6935#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6936#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6937#[cfg_attr(feature = "ts", derive(TS))]
6938#[cfg_attr(feature = "ts", ts(export))]
6939pub struct AVAILABLE_MODES_MONITOR_DATA {
6940 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6941 pub seq: u8,
6942}
6943impl AVAILABLE_MODES_MONITOR_DATA {
6944 pub const ENCODED_LEN: usize = 1usize;
6945 pub const DEFAULT: Self = Self { seq: 0_u8 };
6946 #[cfg(feature = "arbitrary")]
6947 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6948 use arbitrary::{Arbitrary, Unstructured};
6949 let mut buf = [0u8; 1024];
6950 rng.fill_bytes(&mut buf);
6951 let mut unstructured = Unstructured::new(&buf);
6952 Self::arbitrary(&mut unstructured).unwrap_or_default()
6953 }
6954}
6955impl Default for AVAILABLE_MODES_MONITOR_DATA {
6956 fn default() -> Self {
6957 Self::DEFAULT.clone()
6958 }
6959}
6960impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6961 type Message = MavMessage;
6962 const ID: u32 = 437u32;
6963 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6964 const EXTRA_CRC: u8 = 30u8;
6965 const ENCODED_LEN: usize = 1usize;
6966 fn deser(
6967 _version: MavlinkVersion,
6968 __input: &[u8],
6969 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6970 let avail_len = __input.len();
6971 let mut payload_buf = [0; Self::ENCODED_LEN];
6972 let mut buf = if avail_len < Self::ENCODED_LEN {
6973 payload_buf[0..avail_len].copy_from_slice(__input);
6974 Bytes::new(&payload_buf)
6975 } else {
6976 Bytes::new(__input)
6977 };
6978 let mut __struct = Self::default();
6979 __struct.seq = buf.get_u8();
6980 Ok(__struct)
6981 }
6982 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6983 let mut __tmp = BytesMut::new(bytes);
6984 #[allow(clippy::absurd_extreme_comparisons)]
6985 #[allow(unused_comparisons)]
6986 if __tmp.remaining() < Self::ENCODED_LEN {
6987 panic!(
6988 "buffer is too small (need {} bytes, but got {})",
6989 Self::ENCODED_LEN,
6990 __tmp.remaining(),
6991 )
6992 }
6993 __tmp.put_u8(self.seq);
6994 if matches!(version, MavlinkVersion::V2) {
6995 let len = __tmp.len();
6996 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6997 } else {
6998 __tmp.len()
6999 }
7000 }
7001}
7002#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
7003#[doc = ""]
7004#[doc = "ID: 372"]
7005#[derive(Debug, Clone, PartialEq)]
7006#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7007#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7008#[cfg_attr(feature = "ts", derive(TS))]
7009#[cfg_attr(feature = "ts", ts(export))]
7010pub struct BATTERY_INFO_DATA {
7011 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
7012 pub discharge_minimum_voltage: f32,
7013 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
7014 pub charging_minimum_voltage: f32,
7015 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
7016 pub resting_minimum_voltage: f32,
7017 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
7018 pub charging_maximum_voltage: f32,
7019 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
7020 pub charging_maximum_current: f32,
7021 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
7022 pub nominal_voltage: f32,
7023 #[doc = "Maximum pack discharge current. 0: field not provided."]
7024 pub discharge_maximum_current: f32,
7025 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
7026 pub discharge_maximum_burst_current: f32,
7027 #[doc = "Fully charged design capacity. 0: field not provided."]
7028 pub design_capacity: f32,
7029 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
7030 pub full_charge_capacity: f32,
7031 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
7032 pub cycle_count: u16,
7033 #[doc = "Battery weight. 0: field not provided."]
7034 pub weight: u16,
7035 #[doc = "Battery ID"]
7036 pub id: u8,
7037 #[doc = "Function of the battery."]
7038 pub battery_function: MavBatteryFunction,
7039 #[doc = "Type (chemistry) of the battery."]
7040 pub mavtype: MavBatteryType,
7041 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
7042 pub state_of_health: u8,
7043 #[doc = "Number of battery cells in series. 0: field not provided."]
7044 pub cells_in_series: u8,
7045 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
7046 #[cfg_attr(feature = "ts", ts(type = "string"))]
7047 pub manufacture_date: CharArray<9>,
7048 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
7049 #[cfg_attr(feature = "ts", ts(type = "string"))]
7050 pub serial_number: CharArray<32>,
7051 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
7052 #[cfg_attr(feature = "ts", ts(type = "string"))]
7053 pub name: CharArray<50>,
7054}
7055impl BATTERY_INFO_DATA {
7056 pub const ENCODED_LEN: usize = 140usize;
7057 pub const DEFAULT: Self = Self {
7058 discharge_minimum_voltage: 0.0_f32,
7059 charging_minimum_voltage: 0.0_f32,
7060 resting_minimum_voltage: 0.0_f32,
7061 charging_maximum_voltage: 0.0_f32,
7062 charging_maximum_current: 0.0_f32,
7063 nominal_voltage: 0.0_f32,
7064 discharge_maximum_current: 0.0_f32,
7065 discharge_maximum_burst_current: 0.0_f32,
7066 design_capacity: 0.0_f32,
7067 full_charge_capacity: 0.0_f32,
7068 cycle_count: 0_u16,
7069 weight: 0_u16,
7070 id: 0_u8,
7071 battery_function: MavBatteryFunction::DEFAULT,
7072 mavtype: MavBatteryType::DEFAULT,
7073 state_of_health: 0_u8,
7074 cells_in_series: 0_u8,
7075 manufacture_date: CharArray::new([0_u8; 9usize]),
7076 serial_number: CharArray::new([0_u8; 32usize]),
7077 name: CharArray::new([0_u8; 50usize]),
7078 };
7079 #[cfg(feature = "arbitrary")]
7080 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7081 use arbitrary::{Arbitrary, Unstructured};
7082 let mut buf = [0u8; 1024];
7083 rng.fill_bytes(&mut buf);
7084 let mut unstructured = Unstructured::new(&buf);
7085 Self::arbitrary(&mut unstructured).unwrap_or_default()
7086 }
7087}
7088impl Default for BATTERY_INFO_DATA {
7089 fn default() -> Self {
7090 Self::DEFAULT.clone()
7091 }
7092}
7093impl MessageData for BATTERY_INFO_DATA {
7094 type Message = MavMessage;
7095 const ID: u32 = 372u32;
7096 const NAME: &'static str = "BATTERY_INFO";
7097 const EXTRA_CRC: u8 = 26u8;
7098 const ENCODED_LEN: usize = 140usize;
7099 fn deser(
7100 _version: MavlinkVersion,
7101 __input: &[u8],
7102 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7103 let avail_len = __input.len();
7104 let mut payload_buf = [0; Self::ENCODED_LEN];
7105 let mut buf = if avail_len < Self::ENCODED_LEN {
7106 payload_buf[0..avail_len].copy_from_slice(__input);
7107 Bytes::new(&payload_buf)
7108 } else {
7109 Bytes::new(__input)
7110 };
7111 let mut __struct = Self::default();
7112 __struct.discharge_minimum_voltage = buf.get_f32_le();
7113 __struct.charging_minimum_voltage = buf.get_f32_le();
7114 __struct.resting_minimum_voltage = buf.get_f32_le();
7115 __struct.charging_maximum_voltage = buf.get_f32_le();
7116 __struct.charging_maximum_current = buf.get_f32_le();
7117 __struct.nominal_voltage = buf.get_f32_le();
7118 __struct.discharge_maximum_current = buf.get_f32_le();
7119 __struct.discharge_maximum_burst_current = buf.get_f32_le();
7120 __struct.design_capacity = buf.get_f32_le();
7121 __struct.full_charge_capacity = buf.get_f32_le();
7122 __struct.cycle_count = buf.get_u16_le();
7123 __struct.weight = buf.get_u16_le();
7124 __struct.id = buf.get_u8();
7125 let tmp = buf.get_u8();
7126 __struct.battery_function =
7127 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7128 enum_type: "MavBatteryFunction",
7129 value: tmp as u32,
7130 })?;
7131 let tmp = buf.get_u8();
7132 __struct.mavtype =
7133 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7134 enum_type: "MavBatteryType",
7135 value: tmp as u32,
7136 })?;
7137 __struct.state_of_health = buf.get_u8();
7138 __struct.cells_in_series = buf.get_u8();
7139 let mut tmp = [0_u8; 9usize];
7140 for v in &mut tmp {
7141 *v = buf.get_u8();
7142 }
7143 __struct.manufacture_date = CharArray::new(tmp);
7144 let mut tmp = [0_u8; 32usize];
7145 for v in &mut tmp {
7146 *v = buf.get_u8();
7147 }
7148 __struct.serial_number = CharArray::new(tmp);
7149 let mut tmp = [0_u8; 50usize];
7150 for v in &mut tmp {
7151 *v = buf.get_u8();
7152 }
7153 __struct.name = CharArray::new(tmp);
7154 Ok(__struct)
7155 }
7156 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7157 let mut __tmp = BytesMut::new(bytes);
7158 #[allow(clippy::absurd_extreme_comparisons)]
7159 #[allow(unused_comparisons)]
7160 if __tmp.remaining() < Self::ENCODED_LEN {
7161 panic!(
7162 "buffer is too small (need {} bytes, but got {})",
7163 Self::ENCODED_LEN,
7164 __tmp.remaining(),
7165 )
7166 }
7167 __tmp.put_f32_le(self.discharge_minimum_voltage);
7168 __tmp.put_f32_le(self.charging_minimum_voltage);
7169 __tmp.put_f32_le(self.resting_minimum_voltage);
7170 __tmp.put_f32_le(self.charging_maximum_voltage);
7171 __tmp.put_f32_le(self.charging_maximum_current);
7172 __tmp.put_f32_le(self.nominal_voltage);
7173 __tmp.put_f32_le(self.discharge_maximum_current);
7174 __tmp.put_f32_le(self.discharge_maximum_burst_current);
7175 __tmp.put_f32_le(self.design_capacity);
7176 __tmp.put_f32_le(self.full_charge_capacity);
7177 __tmp.put_u16_le(self.cycle_count);
7178 __tmp.put_u16_le(self.weight);
7179 __tmp.put_u8(self.id);
7180 __tmp.put_u8(self.battery_function as u8);
7181 __tmp.put_u8(self.mavtype as u8);
7182 __tmp.put_u8(self.state_of_health);
7183 __tmp.put_u8(self.cells_in_series);
7184 for val in &self.manufacture_date {
7185 __tmp.put_u8(*val);
7186 }
7187 for val in &self.serial_number {
7188 __tmp.put_u8(*val);
7189 }
7190 for val in &self.name {
7191 __tmp.put_u8(*val);
7192 }
7193 if matches!(version, MavlinkVersion::V2) {
7194 let len = __tmp.len();
7195 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7196 } else {
7197 __tmp.len()
7198 }
7199 }
7200}
7201#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
7202#[doc = ""]
7203#[doc = "ID: 147"]
7204#[derive(Debug, Clone, PartialEq)]
7205#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7206#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7207#[cfg_attr(feature = "ts", derive(TS))]
7208#[cfg_attr(feature = "ts", ts(export))]
7209pub struct BATTERY_STATUS_DATA {
7210 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
7211 pub current_consumed: i32,
7212 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
7213 pub energy_consumed: i32,
7214 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
7215 pub temperature: i16,
7216 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
7217 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7218 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7219 pub voltages: [u16; 10],
7220 #[doc = "Battery current, -1: autopilot does not measure the current"]
7221 pub current_battery: i16,
7222 #[doc = "Battery ID"]
7223 pub id: u8,
7224 #[doc = "Function of the battery"]
7225 pub battery_function: MavBatteryFunction,
7226 #[doc = "Type (chemistry) of the battery"]
7227 pub mavtype: MavBatteryType,
7228 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
7229 pub battery_remaining: i8,
7230 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
7231 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7232 pub time_remaining: i32,
7233 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
7234 #[cfg_attr(feature = "serde", serde(default))]
7235 pub charge_state: MavBatteryChargeState,
7236 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
7237 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7238 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7239 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7240 pub voltages_ext: [u16; 4],
7241 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
7242 #[cfg_attr(feature = "serde", serde(default))]
7243 pub mode: MavBatteryMode,
7244 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
7245 #[cfg_attr(feature = "serde", serde(default))]
7246 pub fault_bitmask: MavBatteryFault,
7247}
7248impl BATTERY_STATUS_DATA {
7249 pub const ENCODED_LEN: usize = 54usize;
7250 pub const DEFAULT: Self = Self {
7251 current_consumed: 0_i32,
7252 energy_consumed: 0_i32,
7253 temperature: 0_i16,
7254 voltages: [0_u16; 10usize],
7255 current_battery: 0_i16,
7256 id: 0_u8,
7257 battery_function: MavBatteryFunction::DEFAULT,
7258 mavtype: MavBatteryType::DEFAULT,
7259 battery_remaining: 0_i8,
7260 time_remaining: 0_i32,
7261 charge_state: MavBatteryChargeState::DEFAULT,
7262 voltages_ext: [0_u16; 4usize],
7263 mode: MavBatteryMode::DEFAULT,
7264 fault_bitmask: MavBatteryFault::DEFAULT,
7265 };
7266 #[cfg(feature = "arbitrary")]
7267 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7268 use arbitrary::{Arbitrary, Unstructured};
7269 let mut buf = [0u8; 1024];
7270 rng.fill_bytes(&mut buf);
7271 let mut unstructured = Unstructured::new(&buf);
7272 Self::arbitrary(&mut unstructured).unwrap_or_default()
7273 }
7274}
7275impl Default for BATTERY_STATUS_DATA {
7276 fn default() -> Self {
7277 Self::DEFAULT.clone()
7278 }
7279}
7280impl MessageData for BATTERY_STATUS_DATA {
7281 type Message = MavMessage;
7282 const ID: u32 = 147u32;
7283 const NAME: &'static str = "BATTERY_STATUS";
7284 const EXTRA_CRC: u8 = 154u8;
7285 const ENCODED_LEN: usize = 54usize;
7286 fn deser(
7287 _version: MavlinkVersion,
7288 __input: &[u8],
7289 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7290 let avail_len = __input.len();
7291 let mut payload_buf = [0; Self::ENCODED_LEN];
7292 let mut buf = if avail_len < Self::ENCODED_LEN {
7293 payload_buf[0..avail_len].copy_from_slice(__input);
7294 Bytes::new(&payload_buf)
7295 } else {
7296 Bytes::new(__input)
7297 };
7298 let mut __struct = Self::default();
7299 __struct.current_consumed = buf.get_i32_le();
7300 __struct.energy_consumed = buf.get_i32_le();
7301 __struct.temperature = buf.get_i16_le();
7302 for v in &mut __struct.voltages {
7303 let val = buf.get_u16_le();
7304 *v = val;
7305 }
7306 __struct.current_battery = buf.get_i16_le();
7307 __struct.id = buf.get_u8();
7308 let tmp = buf.get_u8();
7309 __struct.battery_function =
7310 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7311 enum_type: "MavBatteryFunction",
7312 value: tmp as u32,
7313 })?;
7314 let tmp = buf.get_u8();
7315 __struct.mavtype =
7316 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7317 enum_type: "MavBatteryType",
7318 value: tmp as u32,
7319 })?;
7320 __struct.battery_remaining = buf.get_i8();
7321 __struct.time_remaining = buf.get_i32_le();
7322 let tmp = buf.get_u8();
7323 __struct.charge_state =
7324 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7325 enum_type: "MavBatteryChargeState",
7326 value: tmp as u32,
7327 })?;
7328 for v in &mut __struct.voltages_ext {
7329 let val = buf.get_u16_le();
7330 *v = val;
7331 }
7332 let tmp = buf.get_u8();
7333 __struct.mode =
7334 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7335 enum_type: "MavBatteryMode",
7336 value: tmp as u32,
7337 })?;
7338 let tmp = buf.get_u32_le();
7339 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
7340 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7341 flag_type: "MavBatteryFault",
7342 value: tmp as u32,
7343 })?;
7344 Ok(__struct)
7345 }
7346 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7347 let mut __tmp = BytesMut::new(bytes);
7348 #[allow(clippy::absurd_extreme_comparisons)]
7349 #[allow(unused_comparisons)]
7350 if __tmp.remaining() < Self::ENCODED_LEN {
7351 panic!(
7352 "buffer is too small (need {} bytes, but got {})",
7353 Self::ENCODED_LEN,
7354 __tmp.remaining(),
7355 )
7356 }
7357 __tmp.put_i32_le(self.current_consumed);
7358 __tmp.put_i32_le(self.energy_consumed);
7359 __tmp.put_i16_le(self.temperature);
7360 for val in &self.voltages {
7361 __tmp.put_u16_le(*val);
7362 }
7363 __tmp.put_i16_le(self.current_battery);
7364 __tmp.put_u8(self.id);
7365 __tmp.put_u8(self.battery_function as u8);
7366 __tmp.put_u8(self.mavtype as u8);
7367 __tmp.put_i8(self.battery_remaining);
7368 if matches!(version, MavlinkVersion::V2) {
7369 __tmp.put_i32_le(self.time_remaining);
7370 __tmp.put_u8(self.charge_state as u8);
7371 for val in &self.voltages_ext {
7372 __tmp.put_u16_le(*val);
7373 }
7374 __tmp.put_u8(self.mode as u8);
7375 __tmp.put_u32_le(self.fault_bitmask.bits());
7376 let len = __tmp.len();
7377 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7378 } else {
7379 __tmp.len()
7380 }
7381 }
7382}
7383#[doc = "Report button state change."]
7384#[doc = ""]
7385#[doc = "ID: 257"]
7386#[derive(Debug, Clone, PartialEq)]
7387#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7388#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7389#[cfg_attr(feature = "ts", derive(TS))]
7390#[cfg_attr(feature = "ts", ts(export))]
7391pub struct BUTTON_CHANGE_DATA {
7392 #[doc = "Timestamp (time since system boot)."]
7393 pub time_boot_ms: u32,
7394 #[doc = "Time of last change of button state."]
7395 pub last_change_ms: u32,
7396 #[doc = "Bitmap for state of buttons."]
7397 pub state: u8,
7398}
7399impl BUTTON_CHANGE_DATA {
7400 pub const ENCODED_LEN: usize = 9usize;
7401 pub const DEFAULT: Self = Self {
7402 time_boot_ms: 0_u32,
7403 last_change_ms: 0_u32,
7404 state: 0_u8,
7405 };
7406 #[cfg(feature = "arbitrary")]
7407 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7408 use arbitrary::{Arbitrary, Unstructured};
7409 let mut buf = [0u8; 1024];
7410 rng.fill_bytes(&mut buf);
7411 let mut unstructured = Unstructured::new(&buf);
7412 Self::arbitrary(&mut unstructured).unwrap_or_default()
7413 }
7414}
7415impl Default for BUTTON_CHANGE_DATA {
7416 fn default() -> Self {
7417 Self::DEFAULT.clone()
7418 }
7419}
7420impl MessageData for BUTTON_CHANGE_DATA {
7421 type Message = MavMessage;
7422 const ID: u32 = 257u32;
7423 const NAME: &'static str = "BUTTON_CHANGE";
7424 const EXTRA_CRC: u8 = 131u8;
7425 const ENCODED_LEN: usize = 9usize;
7426 fn deser(
7427 _version: MavlinkVersion,
7428 __input: &[u8],
7429 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7430 let avail_len = __input.len();
7431 let mut payload_buf = [0; Self::ENCODED_LEN];
7432 let mut buf = if avail_len < Self::ENCODED_LEN {
7433 payload_buf[0..avail_len].copy_from_slice(__input);
7434 Bytes::new(&payload_buf)
7435 } else {
7436 Bytes::new(__input)
7437 };
7438 let mut __struct = Self::default();
7439 __struct.time_boot_ms = buf.get_u32_le();
7440 __struct.last_change_ms = buf.get_u32_le();
7441 __struct.state = buf.get_u8();
7442 Ok(__struct)
7443 }
7444 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7445 let mut __tmp = BytesMut::new(bytes);
7446 #[allow(clippy::absurd_extreme_comparisons)]
7447 #[allow(unused_comparisons)]
7448 if __tmp.remaining() < Self::ENCODED_LEN {
7449 panic!(
7450 "buffer is too small (need {} bytes, but got {})",
7451 Self::ENCODED_LEN,
7452 __tmp.remaining(),
7453 )
7454 }
7455 __tmp.put_u32_le(self.time_boot_ms);
7456 __tmp.put_u32_le(self.last_change_ms);
7457 __tmp.put_u8(self.state);
7458 if matches!(version, MavlinkVersion::V2) {
7459 let len = __tmp.len();
7460 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7461 } else {
7462 __tmp.len()
7463 }
7464 }
7465}
7466#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7467#[doc = ""]
7468#[doc = "ID: 262"]
7469#[derive(Debug, Clone, PartialEq)]
7470#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7471#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7472#[cfg_attr(feature = "ts", derive(TS))]
7473#[cfg_attr(feature = "ts", ts(export))]
7474pub struct CAMERA_CAPTURE_STATUS_DATA {
7475 #[doc = "Timestamp (time since system boot)."]
7476 pub time_boot_ms: u32,
7477 #[doc = "Image capture interval"]
7478 pub image_interval: f32,
7479 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
7480 pub recording_time_ms: u32,
7481 #[doc = "Available storage capacity."]
7482 pub available_capacity: f32,
7483 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
7484 pub image_status: u8,
7485 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
7486 pub video_status: u8,
7487 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
7488 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7489 pub image_count: i32,
7490 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7491 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7492 pub camera_device_id: u8,
7493}
7494impl CAMERA_CAPTURE_STATUS_DATA {
7495 pub const ENCODED_LEN: usize = 23usize;
7496 pub const DEFAULT: Self = Self {
7497 time_boot_ms: 0_u32,
7498 image_interval: 0.0_f32,
7499 recording_time_ms: 0_u32,
7500 available_capacity: 0.0_f32,
7501 image_status: 0_u8,
7502 video_status: 0_u8,
7503 image_count: 0_i32,
7504 camera_device_id: 0_u8,
7505 };
7506 #[cfg(feature = "arbitrary")]
7507 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7508 use arbitrary::{Arbitrary, Unstructured};
7509 let mut buf = [0u8; 1024];
7510 rng.fill_bytes(&mut buf);
7511 let mut unstructured = Unstructured::new(&buf);
7512 Self::arbitrary(&mut unstructured).unwrap_or_default()
7513 }
7514}
7515impl Default for CAMERA_CAPTURE_STATUS_DATA {
7516 fn default() -> Self {
7517 Self::DEFAULT.clone()
7518 }
7519}
7520impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
7521 type Message = MavMessage;
7522 const ID: u32 = 262u32;
7523 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
7524 const EXTRA_CRC: u8 = 12u8;
7525 const ENCODED_LEN: usize = 23usize;
7526 fn deser(
7527 _version: MavlinkVersion,
7528 __input: &[u8],
7529 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7530 let avail_len = __input.len();
7531 let mut payload_buf = [0; Self::ENCODED_LEN];
7532 let mut buf = if avail_len < Self::ENCODED_LEN {
7533 payload_buf[0..avail_len].copy_from_slice(__input);
7534 Bytes::new(&payload_buf)
7535 } else {
7536 Bytes::new(__input)
7537 };
7538 let mut __struct = Self::default();
7539 __struct.time_boot_ms = buf.get_u32_le();
7540 __struct.image_interval = buf.get_f32_le();
7541 __struct.recording_time_ms = buf.get_u32_le();
7542 __struct.available_capacity = buf.get_f32_le();
7543 __struct.image_status = buf.get_u8();
7544 __struct.video_status = buf.get_u8();
7545 __struct.image_count = buf.get_i32_le();
7546 __struct.camera_device_id = buf.get_u8();
7547 Ok(__struct)
7548 }
7549 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7550 let mut __tmp = BytesMut::new(bytes);
7551 #[allow(clippy::absurd_extreme_comparisons)]
7552 #[allow(unused_comparisons)]
7553 if __tmp.remaining() < Self::ENCODED_LEN {
7554 panic!(
7555 "buffer is too small (need {} bytes, but got {})",
7556 Self::ENCODED_LEN,
7557 __tmp.remaining(),
7558 )
7559 }
7560 __tmp.put_u32_le(self.time_boot_ms);
7561 __tmp.put_f32_le(self.image_interval);
7562 __tmp.put_u32_le(self.recording_time_ms);
7563 __tmp.put_f32_le(self.available_capacity);
7564 __tmp.put_u8(self.image_status);
7565 __tmp.put_u8(self.video_status);
7566 if matches!(version, MavlinkVersion::V2) {
7567 __tmp.put_i32_le(self.image_count);
7568 __tmp.put_u8(self.camera_device_id);
7569 let len = __tmp.len();
7570 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7571 } else {
7572 __tmp.len()
7573 }
7574 }
7575}
7576#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7577#[doc = ""]
7578#[doc = "ID: 271"]
7579#[derive(Debug, Clone, PartialEq)]
7580#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7581#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7582#[cfg_attr(feature = "ts", derive(TS))]
7583#[cfg_attr(feature = "ts", ts(export))]
7584pub struct CAMERA_FOV_STATUS_DATA {
7585 #[doc = "Timestamp (time since system boot)."]
7586 pub time_boot_ms: u32,
7587 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7588 pub lat_camera: i32,
7589 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7590 pub lon_camera: i32,
7591 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7592 pub alt_camera: i32,
7593 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7594 pub lat_image: i32,
7595 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7596 pub lon_image: i32,
7597 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7598 pub alt_image: i32,
7599 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7600 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7601 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7602 pub q: [f32; 4],
7603 #[doc = "Horizontal field of view (NaN if unknown)."]
7604 pub hfov: f32,
7605 #[doc = "Vertical field of view (NaN if unknown)."]
7606 pub vfov: f32,
7607 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7608 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7609 pub camera_device_id: u8,
7610}
7611impl CAMERA_FOV_STATUS_DATA {
7612 pub const ENCODED_LEN: usize = 53usize;
7613 pub const DEFAULT: Self = Self {
7614 time_boot_ms: 0_u32,
7615 lat_camera: 0_i32,
7616 lon_camera: 0_i32,
7617 alt_camera: 0_i32,
7618 lat_image: 0_i32,
7619 lon_image: 0_i32,
7620 alt_image: 0_i32,
7621 q: [0.0_f32; 4usize],
7622 hfov: 0.0_f32,
7623 vfov: 0.0_f32,
7624 camera_device_id: 0_u8,
7625 };
7626 #[cfg(feature = "arbitrary")]
7627 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7628 use arbitrary::{Arbitrary, Unstructured};
7629 let mut buf = [0u8; 1024];
7630 rng.fill_bytes(&mut buf);
7631 let mut unstructured = Unstructured::new(&buf);
7632 Self::arbitrary(&mut unstructured).unwrap_or_default()
7633 }
7634}
7635impl Default for CAMERA_FOV_STATUS_DATA {
7636 fn default() -> Self {
7637 Self::DEFAULT.clone()
7638 }
7639}
7640impl MessageData for CAMERA_FOV_STATUS_DATA {
7641 type Message = MavMessage;
7642 const ID: u32 = 271u32;
7643 const NAME: &'static str = "CAMERA_FOV_STATUS";
7644 const EXTRA_CRC: u8 = 22u8;
7645 const ENCODED_LEN: usize = 53usize;
7646 fn deser(
7647 _version: MavlinkVersion,
7648 __input: &[u8],
7649 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7650 let avail_len = __input.len();
7651 let mut payload_buf = [0; Self::ENCODED_LEN];
7652 let mut buf = if avail_len < Self::ENCODED_LEN {
7653 payload_buf[0..avail_len].copy_from_slice(__input);
7654 Bytes::new(&payload_buf)
7655 } else {
7656 Bytes::new(__input)
7657 };
7658 let mut __struct = Self::default();
7659 __struct.time_boot_ms = buf.get_u32_le();
7660 __struct.lat_camera = buf.get_i32_le();
7661 __struct.lon_camera = buf.get_i32_le();
7662 __struct.alt_camera = buf.get_i32_le();
7663 __struct.lat_image = buf.get_i32_le();
7664 __struct.lon_image = buf.get_i32_le();
7665 __struct.alt_image = buf.get_i32_le();
7666 for v in &mut __struct.q {
7667 let val = buf.get_f32_le();
7668 *v = val;
7669 }
7670 __struct.hfov = buf.get_f32_le();
7671 __struct.vfov = buf.get_f32_le();
7672 __struct.camera_device_id = buf.get_u8();
7673 Ok(__struct)
7674 }
7675 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7676 let mut __tmp = BytesMut::new(bytes);
7677 #[allow(clippy::absurd_extreme_comparisons)]
7678 #[allow(unused_comparisons)]
7679 if __tmp.remaining() < Self::ENCODED_LEN {
7680 panic!(
7681 "buffer is too small (need {} bytes, but got {})",
7682 Self::ENCODED_LEN,
7683 __tmp.remaining(),
7684 )
7685 }
7686 __tmp.put_u32_le(self.time_boot_ms);
7687 __tmp.put_i32_le(self.lat_camera);
7688 __tmp.put_i32_le(self.lon_camera);
7689 __tmp.put_i32_le(self.alt_camera);
7690 __tmp.put_i32_le(self.lat_image);
7691 __tmp.put_i32_le(self.lon_image);
7692 __tmp.put_i32_le(self.alt_image);
7693 for val in &self.q {
7694 __tmp.put_f32_le(*val);
7695 }
7696 __tmp.put_f32_le(self.hfov);
7697 __tmp.put_f32_le(self.vfov);
7698 if matches!(version, MavlinkVersion::V2) {
7699 __tmp.put_u8(self.camera_device_id);
7700 let len = __tmp.len();
7701 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7702 } else {
7703 __tmp.len()
7704 }
7705 }
7706}
7707#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7708#[doc = ""]
7709#[doc = "ID: 263"]
7710#[derive(Debug, Clone, PartialEq)]
7711#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7713#[cfg_attr(feature = "ts", derive(TS))]
7714#[cfg_attr(feature = "ts", ts(export))]
7715pub struct CAMERA_IMAGE_CAPTURED_DATA {
7716 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7717 pub time_utc: u64,
7718 #[doc = "Timestamp (time since system boot)."]
7719 pub time_boot_ms: u32,
7720 #[doc = "Latitude where image was taken"]
7721 pub lat: i32,
7722 #[doc = "Longitude where capture was taken"]
7723 pub lon: i32,
7724 #[doc = "Altitude (MSL) where image was taken"]
7725 pub alt: i32,
7726 #[doc = "Altitude above ground"]
7727 pub relative_alt: i32,
7728 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7729 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7730 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7731 pub q: [f32; 4],
7732 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7733 pub image_index: i32,
7734 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7735 pub camera_id: u8,
7736 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7737 pub capture_result: i8,
7738 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7739 #[cfg_attr(feature = "ts", ts(type = "string"))]
7740 pub file_url: CharArray<205>,
7741}
7742impl CAMERA_IMAGE_CAPTURED_DATA {
7743 pub const ENCODED_LEN: usize = 255usize;
7744 pub const DEFAULT: Self = Self {
7745 time_utc: 0_u64,
7746 time_boot_ms: 0_u32,
7747 lat: 0_i32,
7748 lon: 0_i32,
7749 alt: 0_i32,
7750 relative_alt: 0_i32,
7751 q: [0.0_f32; 4usize],
7752 image_index: 0_i32,
7753 camera_id: 0_u8,
7754 capture_result: 0_i8,
7755 file_url: CharArray::new([0_u8; 205usize]),
7756 };
7757 #[cfg(feature = "arbitrary")]
7758 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7759 use arbitrary::{Arbitrary, Unstructured};
7760 let mut buf = [0u8; 1024];
7761 rng.fill_bytes(&mut buf);
7762 let mut unstructured = Unstructured::new(&buf);
7763 Self::arbitrary(&mut unstructured).unwrap_or_default()
7764 }
7765}
7766impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7767 fn default() -> Self {
7768 Self::DEFAULT.clone()
7769 }
7770}
7771impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7772 type Message = MavMessage;
7773 const ID: u32 = 263u32;
7774 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7775 const EXTRA_CRC: u8 = 133u8;
7776 const ENCODED_LEN: usize = 255usize;
7777 fn deser(
7778 _version: MavlinkVersion,
7779 __input: &[u8],
7780 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7781 let avail_len = __input.len();
7782 let mut payload_buf = [0; Self::ENCODED_LEN];
7783 let mut buf = if avail_len < Self::ENCODED_LEN {
7784 payload_buf[0..avail_len].copy_from_slice(__input);
7785 Bytes::new(&payload_buf)
7786 } else {
7787 Bytes::new(__input)
7788 };
7789 let mut __struct = Self::default();
7790 __struct.time_utc = buf.get_u64_le();
7791 __struct.time_boot_ms = buf.get_u32_le();
7792 __struct.lat = buf.get_i32_le();
7793 __struct.lon = buf.get_i32_le();
7794 __struct.alt = buf.get_i32_le();
7795 __struct.relative_alt = buf.get_i32_le();
7796 for v in &mut __struct.q {
7797 let val = buf.get_f32_le();
7798 *v = val;
7799 }
7800 __struct.image_index = buf.get_i32_le();
7801 __struct.camera_id = buf.get_u8();
7802 __struct.capture_result = buf.get_i8();
7803 let mut tmp = [0_u8; 205usize];
7804 for v in &mut tmp {
7805 *v = buf.get_u8();
7806 }
7807 __struct.file_url = CharArray::new(tmp);
7808 Ok(__struct)
7809 }
7810 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7811 let mut __tmp = BytesMut::new(bytes);
7812 #[allow(clippy::absurd_extreme_comparisons)]
7813 #[allow(unused_comparisons)]
7814 if __tmp.remaining() < Self::ENCODED_LEN {
7815 panic!(
7816 "buffer is too small (need {} bytes, but got {})",
7817 Self::ENCODED_LEN,
7818 __tmp.remaining(),
7819 )
7820 }
7821 __tmp.put_u64_le(self.time_utc);
7822 __tmp.put_u32_le(self.time_boot_ms);
7823 __tmp.put_i32_le(self.lat);
7824 __tmp.put_i32_le(self.lon);
7825 __tmp.put_i32_le(self.alt);
7826 __tmp.put_i32_le(self.relative_alt);
7827 for val in &self.q {
7828 __tmp.put_f32_le(*val);
7829 }
7830 __tmp.put_i32_le(self.image_index);
7831 __tmp.put_u8(self.camera_id);
7832 __tmp.put_i8(self.capture_result);
7833 for val in &self.file_url {
7834 __tmp.put_u8(*val);
7835 }
7836 if matches!(version, MavlinkVersion::V2) {
7837 let len = __tmp.len();
7838 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7839 } else {
7840 __tmp.len()
7841 }
7842 }
7843}
7844#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7845#[doc = ""]
7846#[doc = "ID: 259"]
7847#[derive(Debug, Clone, PartialEq)]
7848#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7849#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7850#[cfg_attr(feature = "ts", derive(TS))]
7851#[cfg_attr(feature = "ts", ts(export))]
7852pub struct CAMERA_INFORMATION_DATA {
7853 #[doc = "Timestamp (time since system boot)."]
7854 pub time_boot_ms: u32,
7855 #[doc = "0xff). Use 0 if not known."]
7856 pub firmware_version: u32,
7857 #[doc = "Focal length. Use NaN if not known."]
7858 pub focal_length: f32,
7859 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7860 pub sensor_size_h: f32,
7861 #[doc = "Image sensor size vertical. Use NaN if not known."]
7862 pub sensor_size_v: f32,
7863 #[doc = "Bitmap of camera capability flags."]
7864 pub flags: CameraCapFlags,
7865 #[doc = "Horizontal image resolution. Use 0 if not known."]
7866 pub resolution_h: u16,
7867 #[doc = "Vertical image resolution. Use 0 if not known."]
7868 pub resolution_v: u16,
7869 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7870 pub cam_definition_version: u16,
7871 #[doc = "Name of the camera vendor"]
7872 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7873 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7874 pub vendor_name: [u8; 32],
7875 #[doc = "Name of the camera model"]
7876 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7877 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7878 pub model_name: [u8; 32],
7879 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7880 pub lens_id: u8,
7881 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7882 #[cfg_attr(feature = "ts", ts(type = "string"))]
7883 pub cam_definition_uri: CharArray<140>,
7884 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7885 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7886 pub gimbal_device_id: u8,
7887 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7888 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7889 pub camera_device_id: u8,
7890}
7891impl CAMERA_INFORMATION_DATA {
7892 pub const ENCODED_LEN: usize = 237usize;
7893 pub const DEFAULT: Self = Self {
7894 time_boot_ms: 0_u32,
7895 firmware_version: 0_u32,
7896 focal_length: 0.0_f32,
7897 sensor_size_h: 0.0_f32,
7898 sensor_size_v: 0.0_f32,
7899 flags: CameraCapFlags::DEFAULT,
7900 resolution_h: 0_u16,
7901 resolution_v: 0_u16,
7902 cam_definition_version: 0_u16,
7903 vendor_name: [0_u8; 32usize],
7904 model_name: [0_u8; 32usize],
7905 lens_id: 0_u8,
7906 cam_definition_uri: CharArray::new([0_u8; 140usize]),
7907 gimbal_device_id: 0_u8,
7908 camera_device_id: 0_u8,
7909 };
7910 #[cfg(feature = "arbitrary")]
7911 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7912 use arbitrary::{Arbitrary, Unstructured};
7913 let mut buf = [0u8; 1024];
7914 rng.fill_bytes(&mut buf);
7915 let mut unstructured = Unstructured::new(&buf);
7916 Self::arbitrary(&mut unstructured).unwrap_or_default()
7917 }
7918}
7919impl Default for CAMERA_INFORMATION_DATA {
7920 fn default() -> Self {
7921 Self::DEFAULT.clone()
7922 }
7923}
7924impl MessageData for CAMERA_INFORMATION_DATA {
7925 type Message = MavMessage;
7926 const ID: u32 = 259u32;
7927 const NAME: &'static str = "CAMERA_INFORMATION";
7928 const EXTRA_CRC: u8 = 92u8;
7929 const ENCODED_LEN: usize = 237usize;
7930 fn deser(
7931 _version: MavlinkVersion,
7932 __input: &[u8],
7933 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7934 let avail_len = __input.len();
7935 let mut payload_buf = [0; Self::ENCODED_LEN];
7936 let mut buf = if avail_len < Self::ENCODED_LEN {
7937 payload_buf[0..avail_len].copy_from_slice(__input);
7938 Bytes::new(&payload_buf)
7939 } else {
7940 Bytes::new(__input)
7941 };
7942 let mut __struct = Self::default();
7943 __struct.time_boot_ms = buf.get_u32_le();
7944 __struct.firmware_version = buf.get_u32_le();
7945 __struct.focal_length = buf.get_f32_le();
7946 __struct.sensor_size_h = buf.get_f32_le();
7947 __struct.sensor_size_v = buf.get_f32_le();
7948 let tmp = buf.get_u32_le();
7949 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7950 ::mavlink_core::error::ParserError::InvalidFlag {
7951 flag_type: "CameraCapFlags",
7952 value: tmp as u32,
7953 },
7954 )?;
7955 __struct.resolution_h = buf.get_u16_le();
7956 __struct.resolution_v = buf.get_u16_le();
7957 __struct.cam_definition_version = buf.get_u16_le();
7958 for v in &mut __struct.vendor_name {
7959 let val = buf.get_u8();
7960 *v = val;
7961 }
7962 for v in &mut __struct.model_name {
7963 let val = buf.get_u8();
7964 *v = val;
7965 }
7966 __struct.lens_id = buf.get_u8();
7967 let mut tmp = [0_u8; 140usize];
7968 for v in &mut tmp {
7969 *v = buf.get_u8();
7970 }
7971 __struct.cam_definition_uri = CharArray::new(tmp);
7972 __struct.gimbal_device_id = buf.get_u8();
7973 __struct.camera_device_id = buf.get_u8();
7974 Ok(__struct)
7975 }
7976 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7977 let mut __tmp = BytesMut::new(bytes);
7978 #[allow(clippy::absurd_extreme_comparisons)]
7979 #[allow(unused_comparisons)]
7980 if __tmp.remaining() < Self::ENCODED_LEN {
7981 panic!(
7982 "buffer is too small (need {} bytes, but got {})",
7983 Self::ENCODED_LEN,
7984 __tmp.remaining(),
7985 )
7986 }
7987 __tmp.put_u32_le(self.time_boot_ms);
7988 __tmp.put_u32_le(self.firmware_version);
7989 __tmp.put_f32_le(self.focal_length);
7990 __tmp.put_f32_le(self.sensor_size_h);
7991 __tmp.put_f32_le(self.sensor_size_v);
7992 __tmp.put_u32_le(self.flags.bits());
7993 __tmp.put_u16_le(self.resolution_h);
7994 __tmp.put_u16_le(self.resolution_v);
7995 __tmp.put_u16_le(self.cam_definition_version);
7996 for val in &self.vendor_name {
7997 __tmp.put_u8(*val);
7998 }
7999 for val in &self.model_name {
8000 __tmp.put_u8(*val);
8001 }
8002 __tmp.put_u8(self.lens_id);
8003 for val in &self.cam_definition_uri {
8004 __tmp.put_u8(*val);
8005 }
8006 if matches!(version, MavlinkVersion::V2) {
8007 __tmp.put_u8(self.gimbal_device_id);
8008 __tmp.put_u8(self.camera_device_id);
8009 let len = __tmp.len();
8010 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8011 } else {
8012 __tmp.len()
8013 }
8014 }
8015}
8016#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
8017#[doc = ""]
8018#[doc = "ID: 260"]
8019#[derive(Debug, Clone, PartialEq)]
8020#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8021#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8022#[cfg_attr(feature = "ts", derive(TS))]
8023#[cfg_attr(feature = "ts", ts(export))]
8024pub struct CAMERA_SETTINGS_DATA {
8025 #[doc = "Timestamp (time since system boot)."]
8026 pub time_boot_ms: u32,
8027 #[doc = "Camera mode"]
8028 pub mode_id: CameraMode,
8029 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
8030 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8031 pub zoomLevel: f32,
8032 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
8033 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8034 pub focusLevel: f32,
8035 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8036 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8037 pub camera_device_id: u8,
8038}
8039impl CAMERA_SETTINGS_DATA {
8040 pub const ENCODED_LEN: usize = 14usize;
8041 pub const DEFAULT: Self = Self {
8042 time_boot_ms: 0_u32,
8043 mode_id: CameraMode::DEFAULT,
8044 zoomLevel: 0.0_f32,
8045 focusLevel: 0.0_f32,
8046 camera_device_id: 0_u8,
8047 };
8048 #[cfg(feature = "arbitrary")]
8049 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8050 use arbitrary::{Arbitrary, Unstructured};
8051 let mut buf = [0u8; 1024];
8052 rng.fill_bytes(&mut buf);
8053 let mut unstructured = Unstructured::new(&buf);
8054 Self::arbitrary(&mut unstructured).unwrap_or_default()
8055 }
8056}
8057impl Default for CAMERA_SETTINGS_DATA {
8058 fn default() -> Self {
8059 Self::DEFAULT.clone()
8060 }
8061}
8062impl MessageData for CAMERA_SETTINGS_DATA {
8063 type Message = MavMessage;
8064 const ID: u32 = 260u32;
8065 const NAME: &'static str = "CAMERA_SETTINGS";
8066 const EXTRA_CRC: u8 = 146u8;
8067 const ENCODED_LEN: usize = 14usize;
8068 fn deser(
8069 _version: MavlinkVersion,
8070 __input: &[u8],
8071 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8072 let avail_len = __input.len();
8073 let mut payload_buf = [0; Self::ENCODED_LEN];
8074 let mut buf = if avail_len < Self::ENCODED_LEN {
8075 payload_buf[0..avail_len].copy_from_slice(__input);
8076 Bytes::new(&payload_buf)
8077 } else {
8078 Bytes::new(__input)
8079 };
8080 let mut __struct = Self::default();
8081 __struct.time_boot_ms = buf.get_u32_le();
8082 let tmp = buf.get_u8();
8083 __struct.mode_id =
8084 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8085 enum_type: "CameraMode",
8086 value: tmp as u32,
8087 })?;
8088 __struct.zoomLevel = buf.get_f32_le();
8089 __struct.focusLevel = buf.get_f32_le();
8090 __struct.camera_device_id = buf.get_u8();
8091 Ok(__struct)
8092 }
8093 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8094 let mut __tmp = BytesMut::new(bytes);
8095 #[allow(clippy::absurd_extreme_comparisons)]
8096 #[allow(unused_comparisons)]
8097 if __tmp.remaining() < Self::ENCODED_LEN {
8098 panic!(
8099 "buffer is too small (need {} bytes, but got {})",
8100 Self::ENCODED_LEN,
8101 __tmp.remaining(),
8102 )
8103 }
8104 __tmp.put_u32_le(self.time_boot_ms);
8105 __tmp.put_u8(self.mode_id as u8);
8106 if matches!(version, MavlinkVersion::V2) {
8107 __tmp.put_f32_le(self.zoomLevel);
8108 __tmp.put_f32_le(self.focusLevel);
8109 __tmp.put_u8(self.camera_device_id);
8110 let len = __tmp.len();
8111 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8112 } else {
8113 __tmp.len()
8114 }
8115 }
8116}
8117#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
8118#[doc = ""]
8119#[doc = "ID: 277"]
8120#[derive(Debug, Clone, PartialEq)]
8121#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8122#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8123#[cfg_attr(feature = "ts", derive(TS))]
8124#[cfg_attr(feature = "ts", ts(export))]
8125pub struct CAMERA_THERMAL_RANGE_DATA {
8126 #[doc = "Timestamp (time since system boot)."]
8127 pub time_boot_ms: u32,
8128 #[doc = "Temperature max."]
8129 pub max: f32,
8130 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
8131 pub max_point_x: f32,
8132 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
8133 pub max_point_y: f32,
8134 #[doc = "Temperature min."]
8135 pub min: f32,
8136 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
8137 pub min_point_x: f32,
8138 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
8139 pub min_point_y: f32,
8140 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
8141 pub stream_id: u8,
8142 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8143 pub camera_device_id: u8,
8144}
8145impl CAMERA_THERMAL_RANGE_DATA {
8146 pub const ENCODED_LEN: usize = 30usize;
8147 pub const DEFAULT: Self = Self {
8148 time_boot_ms: 0_u32,
8149 max: 0.0_f32,
8150 max_point_x: 0.0_f32,
8151 max_point_y: 0.0_f32,
8152 min: 0.0_f32,
8153 min_point_x: 0.0_f32,
8154 min_point_y: 0.0_f32,
8155 stream_id: 0_u8,
8156 camera_device_id: 0_u8,
8157 };
8158 #[cfg(feature = "arbitrary")]
8159 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8160 use arbitrary::{Arbitrary, Unstructured};
8161 let mut buf = [0u8; 1024];
8162 rng.fill_bytes(&mut buf);
8163 let mut unstructured = Unstructured::new(&buf);
8164 Self::arbitrary(&mut unstructured).unwrap_or_default()
8165 }
8166}
8167impl Default for CAMERA_THERMAL_RANGE_DATA {
8168 fn default() -> Self {
8169 Self::DEFAULT.clone()
8170 }
8171}
8172impl MessageData for CAMERA_THERMAL_RANGE_DATA {
8173 type Message = MavMessage;
8174 const ID: u32 = 277u32;
8175 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
8176 const EXTRA_CRC: u8 = 62u8;
8177 const ENCODED_LEN: usize = 30usize;
8178 fn deser(
8179 _version: MavlinkVersion,
8180 __input: &[u8],
8181 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8182 let avail_len = __input.len();
8183 let mut payload_buf = [0; Self::ENCODED_LEN];
8184 let mut buf = if avail_len < Self::ENCODED_LEN {
8185 payload_buf[0..avail_len].copy_from_slice(__input);
8186 Bytes::new(&payload_buf)
8187 } else {
8188 Bytes::new(__input)
8189 };
8190 let mut __struct = Self::default();
8191 __struct.time_boot_ms = buf.get_u32_le();
8192 __struct.max = buf.get_f32_le();
8193 __struct.max_point_x = buf.get_f32_le();
8194 __struct.max_point_y = buf.get_f32_le();
8195 __struct.min = buf.get_f32_le();
8196 __struct.min_point_x = buf.get_f32_le();
8197 __struct.min_point_y = buf.get_f32_le();
8198 __struct.stream_id = buf.get_u8();
8199 __struct.camera_device_id = buf.get_u8();
8200 Ok(__struct)
8201 }
8202 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8203 let mut __tmp = BytesMut::new(bytes);
8204 #[allow(clippy::absurd_extreme_comparisons)]
8205 #[allow(unused_comparisons)]
8206 if __tmp.remaining() < Self::ENCODED_LEN {
8207 panic!(
8208 "buffer is too small (need {} bytes, but got {})",
8209 Self::ENCODED_LEN,
8210 __tmp.remaining(),
8211 )
8212 }
8213 __tmp.put_u32_le(self.time_boot_ms);
8214 __tmp.put_f32_le(self.max);
8215 __tmp.put_f32_le(self.max_point_x);
8216 __tmp.put_f32_le(self.max_point_y);
8217 __tmp.put_f32_le(self.min);
8218 __tmp.put_f32_le(self.min_point_x);
8219 __tmp.put_f32_le(self.min_point_y);
8220 __tmp.put_u8(self.stream_id);
8221 __tmp.put_u8(self.camera_device_id);
8222 if matches!(version, MavlinkVersion::V2) {
8223 let len = __tmp.len();
8224 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8225 } else {
8226 __tmp.len()
8227 }
8228 }
8229}
8230#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
8231#[doc = ""]
8232#[doc = "ID: 276"]
8233#[derive(Debug, Clone, PartialEq)]
8234#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8235#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8236#[cfg_attr(feature = "ts", derive(TS))]
8237#[cfg_attr(feature = "ts", ts(export))]
8238pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
8239 #[doc = "Latitude of tracked object"]
8240 pub lat: i32,
8241 #[doc = "Longitude of tracked object"]
8242 pub lon: i32,
8243 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
8244 pub alt: f32,
8245 #[doc = "Horizontal accuracy. NAN if unknown"]
8246 pub h_acc: f32,
8247 #[doc = "Vertical accuracy. NAN if unknown"]
8248 pub v_acc: f32,
8249 #[doc = "North velocity of tracked object. NAN if unknown"]
8250 pub vel_n: f32,
8251 #[doc = "East velocity of tracked object. NAN if unknown"]
8252 pub vel_e: f32,
8253 #[doc = "Down velocity of tracked object. NAN if unknown"]
8254 pub vel_d: f32,
8255 #[doc = "Velocity accuracy. NAN if unknown"]
8256 pub vel_acc: f32,
8257 #[doc = "Distance between camera and tracked object. NAN if unknown"]
8258 pub dist: f32,
8259 #[doc = "Heading in radians, in NED. NAN if unknown"]
8260 pub hdg: f32,
8261 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
8262 pub hdg_acc: f32,
8263 #[doc = "Current tracking status"]
8264 pub tracking_status: CameraTrackingStatusFlags,
8265 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8266 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8267 pub camera_device_id: u8,
8268}
8269impl CAMERA_TRACKING_GEO_STATUS_DATA {
8270 pub const ENCODED_LEN: usize = 50usize;
8271 pub const DEFAULT: Self = Self {
8272 lat: 0_i32,
8273 lon: 0_i32,
8274 alt: 0.0_f32,
8275 h_acc: 0.0_f32,
8276 v_acc: 0.0_f32,
8277 vel_n: 0.0_f32,
8278 vel_e: 0.0_f32,
8279 vel_d: 0.0_f32,
8280 vel_acc: 0.0_f32,
8281 dist: 0.0_f32,
8282 hdg: 0.0_f32,
8283 hdg_acc: 0.0_f32,
8284 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8285 camera_device_id: 0_u8,
8286 };
8287 #[cfg(feature = "arbitrary")]
8288 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8289 use arbitrary::{Arbitrary, Unstructured};
8290 let mut buf = [0u8; 1024];
8291 rng.fill_bytes(&mut buf);
8292 let mut unstructured = Unstructured::new(&buf);
8293 Self::arbitrary(&mut unstructured).unwrap_or_default()
8294 }
8295}
8296impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
8297 fn default() -> Self {
8298 Self::DEFAULT.clone()
8299 }
8300}
8301impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
8302 type Message = MavMessage;
8303 const ID: u32 = 276u32;
8304 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
8305 const EXTRA_CRC: u8 = 18u8;
8306 const ENCODED_LEN: usize = 50usize;
8307 fn deser(
8308 _version: MavlinkVersion,
8309 __input: &[u8],
8310 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8311 let avail_len = __input.len();
8312 let mut payload_buf = [0; Self::ENCODED_LEN];
8313 let mut buf = if avail_len < Self::ENCODED_LEN {
8314 payload_buf[0..avail_len].copy_from_slice(__input);
8315 Bytes::new(&payload_buf)
8316 } else {
8317 Bytes::new(__input)
8318 };
8319 let mut __struct = Self::default();
8320 __struct.lat = buf.get_i32_le();
8321 __struct.lon = buf.get_i32_le();
8322 __struct.alt = buf.get_f32_le();
8323 __struct.h_acc = buf.get_f32_le();
8324 __struct.v_acc = buf.get_f32_le();
8325 __struct.vel_n = buf.get_f32_le();
8326 __struct.vel_e = buf.get_f32_le();
8327 __struct.vel_d = buf.get_f32_le();
8328 __struct.vel_acc = buf.get_f32_le();
8329 __struct.dist = buf.get_f32_le();
8330 __struct.hdg = buf.get_f32_le();
8331 __struct.hdg_acc = buf.get_f32_le();
8332 let tmp = buf.get_u8();
8333 __struct.tracking_status =
8334 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8335 enum_type: "CameraTrackingStatusFlags",
8336 value: tmp as u32,
8337 })?;
8338 __struct.camera_device_id = buf.get_u8();
8339 Ok(__struct)
8340 }
8341 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8342 let mut __tmp = BytesMut::new(bytes);
8343 #[allow(clippy::absurd_extreme_comparisons)]
8344 #[allow(unused_comparisons)]
8345 if __tmp.remaining() < Self::ENCODED_LEN {
8346 panic!(
8347 "buffer is too small (need {} bytes, but got {})",
8348 Self::ENCODED_LEN,
8349 __tmp.remaining(),
8350 )
8351 }
8352 __tmp.put_i32_le(self.lat);
8353 __tmp.put_i32_le(self.lon);
8354 __tmp.put_f32_le(self.alt);
8355 __tmp.put_f32_le(self.h_acc);
8356 __tmp.put_f32_le(self.v_acc);
8357 __tmp.put_f32_le(self.vel_n);
8358 __tmp.put_f32_le(self.vel_e);
8359 __tmp.put_f32_le(self.vel_d);
8360 __tmp.put_f32_le(self.vel_acc);
8361 __tmp.put_f32_le(self.dist);
8362 __tmp.put_f32_le(self.hdg);
8363 __tmp.put_f32_le(self.hdg_acc);
8364 __tmp.put_u8(self.tracking_status as u8);
8365 if matches!(version, MavlinkVersion::V2) {
8366 __tmp.put_u8(self.camera_device_id);
8367 let len = __tmp.len();
8368 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8369 } else {
8370 __tmp.len()
8371 }
8372 }
8373}
8374#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
8375#[doc = ""]
8376#[doc = "ID: 275"]
8377#[derive(Debug, Clone, PartialEq)]
8378#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8379#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8380#[cfg_attr(feature = "ts", derive(TS))]
8381#[cfg_attr(feature = "ts", ts(export))]
8382pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
8383 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8384 pub point_x: f32,
8385 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8386 pub point_y: f32,
8387 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
8388 pub radius: f32,
8389 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8390 pub rec_top_x: f32,
8391 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8392 pub rec_top_y: f32,
8393 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8394 pub rec_bottom_x: f32,
8395 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8396 pub rec_bottom_y: f32,
8397 #[doc = "Current tracking status"]
8398 pub tracking_status: CameraTrackingStatusFlags,
8399 #[doc = "Current tracking mode"]
8400 pub tracking_mode: CameraTrackingMode,
8401 #[doc = "Defines location of target data"]
8402 pub target_data: CameraTrackingTargetData,
8403 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8404 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8405 pub camera_device_id: u8,
8406}
8407impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
8408 pub const ENCODED_LEN: usize = 32usize;
8409 pub const DEFAULT: Self = Self {
8410 point_x: 0.0_f32,
8411 point_y: 0.0_f32,
8412 radius: 0.0_f32,
8413 rec_top_x: 0.0_f32,
8414 rec_top_y: 0.0_f32,
8415 rec_bottom_x: 0.0_f32,
8416 rec_bottom_y: 0.0_f32,
8417 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8418 tracking_mode: CameraTrackingMode::DEFAULT,
8419 target_data: CameraTrackingTargetData::DEFAULT,
8420 camera_device_id: 0_u8,
8421 };
8422 #[cfg(feature = "arbitrary")]
8423 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8424 use arbitrary::{Arbitrary, Unstructured};
8425 let mut buf = [0u8; 1024];
8426 rng.fill_bytes(&mut buf);
8427 let mut unstructured = Unstructured::new(&buf);
8428 Self::arbitrary(&mut unstructured).unwrap_or_default()
8429 }
8430}
8431impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8432 fn default() -> Self {
8433 Self::DEFAULT.clone()
8434 }
8435}
8436impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8437 type Message = MavMessage;
8438 const ID: u32 = 275u32;
8439 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
8440 const EXTRA_CRC: u8 = 126u8;
8441 const ENCODED_LEN: usize = 32usize;
8442 fn deser(
8443 _version: MavlinkVersion,
8444 __input: &[u8],
8445 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8446 let avail_len = __input.len();
8447 let mut payload_buf = [0; Self::ENCODED_LEN];
8448 let mut buf = if avail_len < Self::ENCODED_LEN {
8449 payload_buf[0..avail_len].copy_from_slice(__input);
8450 Bytes::new(&payload_buf)
8451 } else {
8452 Bytes::new(__input)
8453 };
8454 let mut __struct = Self::default();
8455 __struct.point_x = buf.get_f32_le();
8456 __struct.point_y = buf.get_f32_le();
8457 __struct.radius = buf.get_f32_le();
8458 __struct.rec_top_x = buf.get_f32_le();
8459 __struct.rec_top_y = buf.get_f32_le();
8460 __struct.rec_bottom_x = buf.get_f32_le();
8461 __struct.rec_bottom_y = buf.get_f32_le();
8462 let tmp = buf.get_u8();
8463 __struct.tracking_status =
8464 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8465 enum_type: "CameraTrackingStatusFlags",
8466 value: tmp as u32,
8467 })?;
8468 let tmp = buf.get_u8();
8469 __struct.tracking_mode =
8470 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8471 enum_type: "CameraTrackingMode",
8472 value: tmp as u32,
8473 })?;
8474 let tmp = buf.get_u8();
8475 __struct.target_data =
8476 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
8477 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8478 flag_type: "CameraTrackingTargetData",
8479 value: tmp as u32,
8480 })?;
8481 __struct.camera_device_id = buf.get_u8();
8482 Ok(__struct)
8483 }
8484 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8485 let mut __tmp = BytesMut::new(bytes);
8486 #[allow(clippy::absurd_extreme_comparisons)]
8487 #[allow(unused_comparisons)]
8488 if __tmp.remaining() < Self::ENCODED_LEN {
8489 panic!(
8490 "buffer is too small (need {} bytes, but got {})",
8491 Self::ENCODED_LEN,
8492 __tmp.remaining(),
8493 )
8494 }
8495 __tmp.put_f32_le(self.point_x);
8496 __tmp.put_f32_le(self.point_y);
8497 __tmp.put_f32_le(self.radius);
8498 __tmp.put_f32_le(self.rec_top_x);
8499 __tmp.put_f32_le(self.rec_top_y);
8500 __tmp.put_f32_le(self.rec_bottom_x);
8501 __tmp.put_f32_le(self.rec_bottom_y);
8502 __tmp.put_u8(self.tracking_status as u8);
8503 __tmp.put_u8(self.tracking_mode as u8);
8504 __tmp.put_u8(self.target_data.bits());
8505 if matches!(version, MavlinkVersion::V2) {
8506 __tmp.put_u8(self.camera_device_id);
8507 let len = __tmp.len();
8508 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8509 } else {
8510 __tmp.len()
8511 }
8512 }
8513}
8514#[doc = "Camera-IMU triggering and synchronisation message."]
8515#[doc = ""]
8516#[doc = "ID: 112"]
8517#[derive(Debug, Clone, PartialEq)]
8518#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8519#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8520#[cfg_attr(feature = "ts", derive(TS))]
8521#[cfg_attr(feature = "ts", ts(export))]
8522pub struct CAMERA_TRIGGER_DATA {
8523 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8524 pub time_usec: u64,
8525 #[doc = "Image frame sequence"]
8526 pub seq: u32,
8527}
8528impl CAMERA_TRIGGER_DATA {
8529 pub const ENCODED_LEN: usize = 12usize;
8530 pub const DEFAULT: Self = Self {
8531 time_usec: 0_u64,
8532 seq: 0_u32,
8533 };
8534 #[cfg(feature = "arbitrary")]
8535 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8536 use arbitrary::{Arbitrary, Unstructured};
8537 let mut buf = [0u8; 1024];
8538 rng.fill_bytes(&mut buf);
8539 let mut unstructured = Unstructured::new(&buf);
8540 Self::arbitrary(&mut unstructured).unwrap_or_default()
8541 }
8542}
8543impl Default for CAMERA_TRIGGER_DATA {
8544 fn default() -> Self {
8545 Self::DEFAULT.clone()
8546 }
8547}
8548impl MessageData for CAMERA_TRIGGER_DATA {
8549 type Message = MavMessage;
8550 const ID: u32 = 112u32;
8551 const NAME: &'static str = "CAMERA_TRIGGER";
8552 const EXTRA_CRC: u8 = 174u8;
8553 const ENCODED_LEN: usize = 12usize;
8554 fn deser(
8555 _version: MavlinkVersion,
8556 __input: &[u8],
8557 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8558 let avail_len = __input.len();
8559 let mut payload_buf = [0; Self::ENCODED_LEN];
8560 let mut buf = if avail_len < Self::ENCODED_LEN {
8561 payload_buf[0..avail_len].copy_from_slice(__input);
8562 Bytes::new(&payload_buf)
8563 } else {
8564 Bytes::new(__input)
8565 };
8566 let mut __struct = Self::default();
8567 __struct.time_usec = buf.get_u64_le();
8568 __struct.seq = buf.get_u32_le();
8569 Ok(__struct)
8570 }
8571 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8572 let mut __tmp = BytesMut::new(bytes);
8573 #[allow(clippy::absurd_extreme_comparisons)]
8574 #[allow(unused_comparisons)]
8575 if __tmp.remaining() < Self::ENCODED_LEN {
8576 panic!(
8577 "buffer is too small (need {} bytes, but got {})",
8578 Self::ENCODED_LEN,
8579 __tmp.remaining(),
8580 )
8581 }
8582 __tmp.put_u64_le(self.time_usec);
8583 __tmp.put_u32_le(self.seq);
8584 if matches!(version, MavlinkVersion::V2) {
8585 let len = __tmp.len();
8586 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8587 } else {
8588 __tmp.len()
8589 }
8590 }
8591}
8592#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8593#[doc = ""]
8594#[doc = "ID: 387"]
8595#[derive(Debug, Clone, PartialEq)]
8596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8597#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8598#[cfg_attr(feature = "ts", derive(TS))]
8599#[cfg_attr(feature = "ts", ts(export))]
8600pub struct CANFD_FRAME_DATA {
8601 #[doc = "Frame ID"]
8602 pub id: u32,
8603 #[doc = "System ID."]
8604 pub target_system: u8,
8605 #[doc = "Component ID."]
8606 pub target_component: u8,
8607 #[doc = "bus number"]
8608 pub bus: u8,
8609 #[doc = "Frame length"]
8610 pub len: u8,
8611 #[doc = "Frame data"]
8612 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8613 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8614 pub data: [u8; 64],
8615}
8616impl CANFD_FRAME_DATA {
8617 pub const ENCODED_LEN: usize = 72usize;
8618 pub const DEFAULT: Self = Self {
8619 id: 0_u32,
8620 target_system: 0_u8,
8621 target_component: 0_u8,
8622 bus: 0_u8,
8623 len: 0_u8,
8624 data: [0_u8; 64usize],
8625 };
8626 #[cfg(feature = "arbitrary")]
8627 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8628 use arbitrary::{Arbitrary, Unstructured};
8629 let mut buf = [0u8; 1024];
8630 rng.fill_bytes(&mut buf);
8631 let mut unstructured = Unstructured::new(&buf);
8632 Self::arbitrary(&mut unstructured).unwrap_or_default()
8633 }
8634}
8635impl Default for CANFD_FRAME_DATA {
8636 fn default() -> Self {
8637 Self::DEFAULT.clone()
8638 }
8639}
8640impl MessageData for CANFD_FRAME_DATA {
8641 type Message = MavMessage;
8642 const ID: u32 = 387u32;
8643 const NAME: &'static str = "CANFD_FRAME";
8644 const EXTRA_CRC: u8 = 4u8;
8645 const ENCODED_LEN: usize = 72usize;
8646 fn deser(
8647 _version: MavlinkVersion,
8648 __input: &[u8],
8649 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8650 let avail_len = __input.len();
8651 let mut payload_buf = [0; Self::ENCODED_LEN];
8652 let mut buf = if avail_len < Self::ENCODED_LEN {
8653 payload_buf[0..avail_len].copy_from_slice(__input);
8654 Bytes::new(&payload_buf)
8655 } else {
8656 Bytes::new(__input)
8657 };
8658 let mut __struct = Self::default();
8659 __struct.id = buf.get_u32_le();
8660 __struct.target_system = buf.get_u8();
8661 __struct.target_component = buf.get_u8();
8662 __struct.bus = buf.get_u8();
8663 __struct.len = buf.get_u8();
8664 for v in &mut __struct.data {
8665 let val = buf.get_u8();
8666 *v = val;
8667 }
8668 Ok(__struct)
8669 }
8670 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8671 let mut __tmp = BytesMut::new(bytes);
8672 #[allow(clippy::absurd_extreme_comparisons)]
8673 #[allow(unused_comparisons)]
8674 if __tmp.remaining() < Self::ENCODED_LEN {
8675 panic!(
8676 "buffer is too small (need {} bytes, but got {})",
8677 Self::ENCODED_LEN,
8678 __tmp.remaining(),
8679 )
8680 }
8681 __tmp.put_u32_le(self.id);
8682 __tmp.put_u8(self.target_system);
8683 __tmp.put_u8(self.target_component);
8684 __tmp.put_u8(self.bus);
8685 __tmp.put_u8(self.len);
8686 for val in &self.data {
8687 __tmp.put_u8(*val);
8688 }
8689 if matches!(version, MavlinkVersion::V2) {
8690 let len = __tmp.len();
8691 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8692 } else {
8693 __tmp.len()
8694 }
8695 }
8696}
8697#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8698#[doc = ""]
8699#[doc = "ID: 388"]
8700#[derive(Debug, Clone, PartialEq)]
8701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8702#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8703#[cfg_attr(feature = "ts", derive(TS))]
8704#[cfg_attr(feature = "ts", ts(export))]
8705pub struct CAN_FILTER_MODIFY_DATA {
8706 #[doc = "filter IDs, length num_ids"]
8707 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8708 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8709 pub ids: [u16; 16],
8710 #[doc = "System ID."]
8711 pub target_system: u8,
8712 #[doc = "Component ID."]
8713 pub target_component: u8,
8714 #[doc = "bus number"]
8715 pub bus: u8,
8716 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8717 pub operation: CanFilterOp,
8718 #[doc = "number of IDs in filter list"]
8719 pub num_ids: u8,
8720}
8721impl CAN_FILTER_MODIFY_DATA {
8722 pub const ENCODED_LEN: usize = 37usize;
8723 pub const DEFAULT: Self = Self {
8724 ids: [0_u16; 16usize],
8725 target_system: 0_u8,
8726 target_component: 0_u8,
8727 bus: 0_u8,
8728 operation: CanFilterOp::DEFAULT,
8729 num_ids: 0_u8,
8730 };
8731 #[cfg(feature = "arbitrary")]
8732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8733 use arbitrary::{Arbitrary, Unstructured};
8734 let mut buf = [0u8; 1024];
8735 rng.fill_bytes(&mut buf);
8736 let mut unstructured = Unstructured::new(&buf);
8737 Self::arbitrary(&mut unstructured).unwrap_or_default()
8738 }
8739}
8740impl Default for CAN_FILTER_MODIFY_DATA {
8741 fn default() -> Self {
8742 Self::DEFAULT.clone()
8743 }
8744}
8745impl MessageData for CAN_FILTER_MODIFY_DATA {
8746 type Message = MavMessage;
8747 const ID: u32 = 388u32;
8748 const NAME: &'static str = "CAN_FILTER_MODIFY";
8749 const EXTRA_CRC: u8 = 8u8;
8750 const ENCODED_LEN: usize = 37usize;
8751 fn deser(
8752 _version: MavlinkVersion,
8753 __input: &[u8],
8754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8755 let avail_len = __input.len();
8756 let mut payload_buf = [0; Self::ENCODED_LEN];
8757 let mut buf = if avail_len < Self::ENCODED_LEN {
8758 payload_buf[0..avail_len].copy_from_slice(__input);
8759 Bytes::new(&payload_buf)
8760 } else {
8761 Bytes::new(__input)
8762 };
8763 let mut __struct = Self::default();
8764 for v in &mut __struct.ids {
8765 let val = buf.get_u16_le();
8766 *v = val;
8767 }
8768 __struct.target_system = buf.get_u8();
8769 __struct.target_component = buf.get_u8();
8770 __struct.bus = buf.get_u8();
8771 let tmp = buf.get_u8();
8772 __struct.operation =
8773 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8774 enum_type: "CanFilterOp",
8775 value: tmp as u32,
8776 })?;
8777 __struct.num_ids = buf.get_u8();
8778 Ok(__struct)
8779 }
8780 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8781 let mut __tmp = BytesMut::new(bytes);
8782 #[allow(clippy::absurd_extreme_comparisons)]
8783 #[allow(unused_comparisons)]
8784 if __tmp.remaining() < Self::ENCODED_LEN {
8785 panic!(
8786 "buffer is too small (need {} bytes, but got {})",
8787 Self::ENCODED_LEN,
8788 __tmp.remaining(),
8789 )
8790 }
8791 for val in &self.ids {
8792 __tmp.put_u16_le(*val);
8793 }
8794 __tmp.put_u8(self.target_system);
8795 __tmp.put_u8(self.target_component);
8796 __tmp.put_u8(self.bus);
8797 __tmp.put_u8(self.operation as u8);
8798 __tmp.put_u8(self.num_ids);
8799 if matches!(version, MavlinkVersion::V2) {
8800 let len = __tmp.len();
8801 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8802 } else {
8803 __tmp.len()
8804 }
8805 }
8806}
8807#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8808#[doc = ""]
8809#[doc = "ID: 386"]
8810#[derive(Debug, Clone, PartialEq)]
8811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8812#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8813#[cfg_attr(feature = "ts", derive(TS))]
8814#[cfg_attr(feature = "ts", ts(export))]
8815pub struct CAN_FRAME_DATA {
8816 #[doc = "Frame ID"]
8817 pub id: u32,
8818 #[doc = "System ID."]
8819 pub target_system: u8,
8820 #[doc = "Component ID."]
8821 pub target_component: u8,
8822 #[doc = "Bus number"]
8823 pub bus: u8,
8824 #[doc = "Frame length"]
8825 pub len: u8,
8826 #[doc = "Frame data"]
8827 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8828 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8829 pub data: [u8; 8],
8830}
8831impl CAN_FRAME_DATA {
8832 pub const ENCODED_LEN: usize = 16usize;
8833 pub const DEFAULT: Self = Self {
8834 id: 0_u32,
8835 target_system: 0_u8,
8836 target_component: 0_u8,
8837 bus: 0_u8,
8838 len: 0_u8,
8839 data: [0_u8; 8usize],
8840 };
8841 #[cfg(feature = "arbitrary")]
8842 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8843 use arbitrary::{Arbitrary, Unstructured};
8844 let mut buf = [0u8; 1024];
8845 rng.fill_bytes(&mut buf);
8846 let mut unstructured = Unstructured::new(&buf);
8847 Self::arbitrary(&mut unstructured).unwrap_or_default()
8848 }
8849}
8850impl Default for CAN_FRAME_DATA {
8851 fn default() -> Self {
8852 Self::DEFAULT.clone()
8853 }
8854}
8855impl MessageData for CAN_FRAME_DATA {
8856 type Message = MavMessage;
8857 const ID: u32 = 386u32;
8858 const NAME: &'static str = "CAN_FRAME";
8859 const EXTRA_CRC: u8 = 132u8;
8860 const ENCODED_LEN: usize = 16usize;
8861 fn deser(
8862 _version: MavlinkVersion,
8863 __input: &[u8],
8864 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8865 let avail_len = __input.len();
8866 let mut payload_buf = [0; Self::ENCODED_LEN];
8867 let mut buf = if avail_len < Self::ENCODED_LEN {
8868 payload_buf[0..avail_len].copy_from_slice(__input);
8869 Bytes::new(&payload_buf)
8870 } else {
8871 Bytes::new(__input)
8872 };
8873 let mut __struct = Self::default();
8874 __struct.id = buf.get_u32_le();
8875 __struct.target_system = buf.get_u8();
8876 __struct.target_component = buf.get_u8();
8877 __struct.bus = buf.get_u8();
8878 __struct.len = buf.get_u8();
8879 for v in &mut __struct.data {
8880 let val = buf.get_u8();
8881 *v = val;
8882 }
8883 Ok(__struct)
8884 }
8885 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8886 let mut __tmp = BytesMut::new(bytes);
8887 #[allow(clippy::absurd_extreme_comparisons)]
8888 #[allow(unused_comparisons)]
8889 if __tmp.remaining() < Self::ENCODED_LEN {
8890 panic!(
8891 "buffer is too small (need {} bytes, but got {})",
8892 Self::ENCODED_LEN,
8893 __tmp.remaining(),
8894 )
8895 }
8896 __tmp.put_u32_le(self.id);
8897 __tmp.put_u8(self.target_system);
8898 __tmp.put_u8(self.target_component);
8899 __tmp.put_u8(self.bus);
8900 __tmp.put_u8(self.len);
8901 for val in &self.data {
8902 __tmp.put_u8(*val);
8903 }
8904 if matches!(version, MavlinkVersion::V2) {
8905 let len = __tmp.len();
8906 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8907 } else {
8908 __tmp.len()
8909 }
8910 }
8911}
8912#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8913#[doc = ""]
8914#[doc = "ID: 336"]
8915#[derive(Debug, Clone, PartialEq)]
8916#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8917#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8918#[cfg_attr(feature = "ts", derive(TS))]
8919#[cfg_attr(feature = "ts", ts(export))]
8920pub struct CELLULAR_CONFIG_DATA {
8921 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8922 pub enable_lte: u8,
8923 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8924 pub enable_pin: u8,
8925 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8926 #[cfg_attr(feature = "ts", ts(type = "string"))]
8927 pub pin: CharArray<16>,
8928 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8929 #[cfg_attr(feature = "ts", ts(type = "string"))]
8930 pub new_pin: CharArray<16>,
8931 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8932 #[cfg_attr(feature = "ts", ts(type = "string"))]
8933 pub apn: CharArray<32>,
8934 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8935 #[cfg_attr(feature = "ts", ts(type = "string"))]
8936 pub puk: CharArray<16>,
8937 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8938 pub roaming: u8,
8939 #[doc = "Message acceptance response (sent back to GS)."]
8940 pub response: CellularConfigResponse,
8941}
8942impl CELLULAR_CONFIG_DATA {
8943 pub const ENCODED_LEN: usize = 84usize;
8944 pub const DEFAULT: Self = Self {
8945 enable_lte: 0_u8,
8946 enable_pin: 0_u8,
8947 pin: CharArray::new([0_u8; 16usize]),
8948 new_pin: CharArray::new([0_u8; 16usize]),
8949 apn: CharArray::new([0_u8; 32usize]),
8950 puk: CharArray::new([0_u8; 16usize]),
8951 roaming: 0_u8,
8952 response: CellularConfigResponse::DEFAULT,
8953 };
8954 #[cfg(feature = "arbitrary")]
8955 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8956 use arbitrary::{Arbitrary, Unstructured};
8957 let mut buf = [0u8; 1024];
8958 rng.fill_bytes(&mut buf);
8959 let mut unstructured = Unstructured::new(&buf);
8960 Self::arbitrary(&mut unstructured).unwrap_or_default()
8961 }
8962}
8963impl Default for CELLULAR_CONFIG_DATA {
8964 fn default() -> Self {
8965 Self::DEFAULT.clone()
8966 }
8967}
8968impl MessageData for CELLULAR_CONFIG_DATA {
8969 type Message = MavMessage;
8970 const ID: u32 = 336u32;
8971 const NAME: &'static str = "CELLULAR_CONFIG";
8972 const EXTRA_CRC: u8 = 245u8;
8973 const ENCODED_LEN: usize = 84usize;
8974 fn deser(
8975 _version: MavlinkVersion,
8976 __input: &[u8],
8977 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8978 let avail_len = __input.len();
8979 let mut payload_buf = [0; Self::ENCODED_LEN];
8980 let mut buf = if avail_len < Self::ENCODED_LEN {
8981 payload_buf[0..avail_len].copy_from_slice(__input);
8982 Bytes::new(&payload_buf)
8983 } else {
8984 Bytes::new(__input)
8985 };
8986 let mut __struct = Self::default();
8987 __struct.enable_lte = buf.get_u8();
8988 __struct.enable_pin = buf.get_u8();
8989 let mut tmp = [0_u8; 16usize];
8990 for v in &mut tmp {
8991 *v = buf.get_u8();
8992 }
8993 __struct.pin = CharArray::new(tmp);
8994 let mut tmp = [0_u8; 16usize];
8995 for v in &mut tmp {
8996 *v = buf.get_u8();
8997 }
8998 __struct.new_pin = CharArray::new(tmp);
8999 let mut tmp = [0_u8; 32usize];
9000 for v in &mut tmp {
9001 *v = buf.get_u8();
9002 }
9003 __struct.apn = CharArray::new(tmp);
9004 let mut tmp = [0_u8; 16usize];
9005 for v in &mut tmp {
9006 *v = buf.get_u8();
9007 }
9008 __struct.puk = CharArray::new(tmp);
9009 __struct.roaming = buf.get_u8();
9010 let tmp = buf.get_u8();
9011 __struct.response =
9012 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9013 enum_type: "CellularConfigResponse",
9014 value: tmp as u32,
9015 })?;
9016 Ok(__struct)
9017 }
9018 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9019 let mut __tmp = BytesMut::new(bytes);
9020 #[allow(clippy::absurd_extreme_comparisons)]
9021 #[allow(unused_comparisons)]
9022 if __tmp.remaining() < Self::ENCODED_LEN {
9023 panic!(
9024 "buffer is too small (need {} bytes, but got {})",
9025 Self::ENCODED_LEN,
9026 __tmp.remaining(),
9027 )
9028 }
9029 __tmp.put_u8(self.enable_lte);
9030 __tmp.put_u8(self.enable_pin);
9031 for val in &self.pin {
9032 __tmp.put_u8(*val);
9033 }
9034 for val in &self.new_pin {
9035 __tmp.put_u8(*val);
9036 }
9037 for val in &self.apn {
9038 __tmp.put_u8(*val);
9039 }
9040 for val in &self.puk {
9041 __tmp.put_u8(*val);
9042 }
9043 __tmp.put_u8(self.roaming);
9044 __tmp.put_u8(self.response as u8);
9045 if matches!(version, MavlinkVersion::V2) {
9046 let len = __tmp.len();
9047 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9048 } else {
9049 __tmp.len()
9050 }
9051 }
9052}
9053#[doc = "Report current used cellular network status."]
9054#[doc = ""]
9055#[doc = "ID: 334"]
9056#[derive(Debug, Clone, PartialEq)]
9057#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9058#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9059#[cfg_attr(feature = "ts", derive(TS))]
9060#[cfg_attr(feature = "ts", ts(export))]
9061pub struct CELLULAR_STATUS_DATA {
9062 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
9063 pub mcc: u16,
9064 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
9065 pub mnc: u16,
9066 #[doc = "Location area code. If unknown, set to 0"]
9067 pub lac: u16,
9068 #[doc = "Cellular modem status"]
9069 pub status: CellularStatusFlag,
9070 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
9071 pub failure_reason: CellularNetworkFailedReason,
9072 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
9073 pub mavtype: CellularNetworkRadioType,
9074 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
9075 pub quality: u8,
9076}
9077impl CELLULAR_STATUS_DATA {
9078 pub const ENCODED_LEN: usize = 10usize;
9079 pub const DEFAULT: Self = Self {
9080 mcc: 0_u16,
9081 mnc: 0_u16,
9082 lac: 0_u16,
9083 status: CellularStatusFlag::DEFAULT,
9084 failure_reason: CellularNetworkFailedReason::DEFAULT,
9085 mavtype: CellularNetworkRadioType::DEFAULT,
9086 quality: 0_u8,
9087 };
9088 #[cfg(feature = "arbitrary")]
9089 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9090 use arbitrary::{Arbitrary, Unstructured};
9091 let mut buf = [0u8; 1024];
9092 rng.fill_bytes(&mut buf);
9093 let mut unstructured = Unstructured::new(&buf);
9094 Self::arbitrary(&mut unstructured).unwrap_or_default()
9095 }
9096}
9097impl Default for CELLULAR_STATUS_DATA {
9098 fn default() -> Self {
9099 Self::DEFAULT.clone()
9100 }
9101}
9102impl MessageData for CELLULAR_STATUS_DATA {
9103 type Message = MavMessage;
9104 const ID: u32 = 334u32;
9105 const NAME: &'static str = "CELLULAR_STATUS";
9106 const EXTRA_CRC: u8 = 72u8;
9107 const ENCODED_LEN: usize = 10usize;
9108 fn deser(
9109 _version: MavlinkVersion,
9110 __input: &[u8],
9111 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9112 let avail_len = __input.len();
9113 let mut payload_buf = [0; Self::ENCODED_LEN];
9114 let mut buf = if avail_len < Self::ENCODED_LEN {
9115 payload_buf[0..avail_len].copy_from_slice(__input);
9116 Bytes::new(&payload_buf)
9117 } else {
9118 Bytes::new(__input)
9119 };
9120 let mut __struct = Self::default();
9121 __struct.mcc = buf.get_u16_le();
9122 __struct.mnc = buf.get_u16_le();
9123 __struct.lac = buf.get_u16_le();
9124 let tmp = buf.get_u8();
9125 __struct.status =
9126 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9127 enum_type: "CellularStatusFlag",
9128 value: tmp as u32,
9129 })?;
9130 let tmp = buf.get_u8();
9131 __struct.failure_reason =
9132 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9133 enum_type: "CellularNetworkFailedReason",
9134 value: tmp as u32,
9135 })?;
9136 let tmp = buf.get_u8();
9137 __struct.mavtype =
9138 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9139 enum_type: "CellularNetworkRadioType",
9140 value: tmp as u32,
9141 })?;
9142 __struct.quality = buf.get_u8();
9143 Ok(__struct)
9144 }
9145 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9146 let mut __tmp = BytesMut::new(bytes);
9147 #[allow(clippy::absurd_extreme_comparisons)]
9148 #[allow(unused_comparisons)]
9149 if __tmp.remaining() < Self::ENCODED_LEN {
9150 panic!(
9151 "buffer is too small (need {} bytes, but got {})",
9152 Self::ENCODED_LEN,
9153 __tmp.remaining(),
9154 )
9155 }
9156 __tmp.put_u16_le(self.mcc);
9157 __tmp.put_u16_le(self.mnc);
9158 __tmp.put_u16_le(self.lac);
9159 __tmp.put_u8(self.status as u8);
9160 __tmp.put_u8(self.failure_reason as u8);
9161 __tmp.put_u8(self.mavtype as u8);
9162 __tmp.put_u8(self.quality);
9163 if matches!(version, MavlinkVersion::V2) {
9164 let len = __tmp.len();
9165 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9166 } else {
9167 __tmp.len()
9168 }
9169 }
9170}
9171#[doc = "Request to control this MAV."]
9172#[doc = ""]
9173#[doc = "ID: 5"]
9174#[derive(Debug, Clone, PartialEq)]
9175#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9176#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9177#[cfg_attr(feature = "ts", derive(TS))]
9178#[cfg_attr(feature = "ts", ts(export))]
9179pub struct CHANGE_OPERATOR_CONTROL_DATA {
9180 #[doc = "System the GCS requests control for"]
9181 pub target_system: u8,
9182 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
9183 pub control_request: u8,
9184 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
9185 pub version: u8,
9186 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
9187 #[cfg_attr(feature = "ts", ts(type = "string"))]
9188 pub passkey: CharArray<25>,
9189}
9190impl CHANGE_OPERATOR_CONTROL_DATA {
9191 pub const ENCODED_LEN: usize = 28usize;
9192 pub const DEFAULT: Self = Self {
9193 target_system: 0_u8,
9194 control_request: 0_u8,
9195 version: 0_u8,
9196 passkey: CharArray::new([0_u8; 25usize]),
9197 };
9198 #[cfg(feature = "arbitrary")]
9199 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9200 use arbitrary::{Arbitrary, Unstructured};
9201 let mut buf = [0u8; 1024];
9202 rng.fill_bytes(&mut buf);
9203 let mut unstructured = Unstructured::new(&buf);
9204 Self::arbitrary(&mut unstructured).unwrap_or_default()
9205 }
9206}
9207impl Default for CHANGE_OPERATOR_CONTROL_DATA {
9208 fn default() -> Self {
9209 Self::DEFAULT.clone()
9210 }
9211}
9212impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
9213 type Message = MavMessage;
9214 const ID: u32 = 5u32;
9215 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
9216 const EXTRA_CRC: u8 = 217u8;
9217 const ENCODED_LEN: usize = 28usize;
9218 fn deser(
9219 _version: MavlinkVersion,
9220 __input: &[u8],
9221 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9222 let avail_len = __input.len();
9223 let mut payload_buf = [0; Self::ENCODED_LEN];
9224 let mut buf = if avail_len < Self::ENCODED_LEN {
9225 payload_buf[0..avail_len].copy_from_slice(__input);
9226 Bytes::new(&payload_buf)
9227 } else {
9228 Bytes::new(__input)
9229 };
9230 let mut __struct = Self::default();
9231 __struct.target_system = buf.get_u8();
9232 __struct.control_request = buf.get_u8();
9233 __struct.version = buf.get_u8();
9234 let mut tmp = [0_u8; 25usize];
9235 for v in &mut tmp {
9236 *v = buf.get_u8();
9237 }
9238 __struct.passkey = CharArray::new(tmp);
9239 Ok(__struct)
9240 }
9241 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9242 let mut __tmp = BytesMut::new(bytes);
9243 #[allow(clippy::absurd_extreme_comparisons)]
9244 #[allow(unused_comparisons)]
9245 if __tmp.remaining() < Self::ENCODED_LEN {
9246 panic!(
9247 "buffer is too small (need {} bytes, but got {})",
9248 Self::ENCODED_LEN,
9249 __tmp.remaining(),
9250 )
9251 }
9252 __tmp.put_u8(self.target_system);
9253 __tmp.put_u8(self.control_request);
9254 __tmp.put_u8(self.version);
9255 for val in &self.passkey {
9256 __tmp.put_u8(*val);
9257 }
9258 if matches!(version, MavlinkVersion::V2) {
9259 let len = __tmp.len();
9260 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9261 } else {
9262 __tmp.len()
9263 }
9264 }
9265}
9266#[doc = "Accept / deny control of this MAV."]
9267#[doc = ""]
9268#[doc = "ID: 6"]
9269#[derive(Debug, Clone, PartialEq)]
9270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9271#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9272#[cfg_attr(feature = "ts", derive(TS))]
9273#[cfg_attr(feature = "ts", ts(export))]
9274pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
9275 #[doc = "ID of the GCS this message"]
9276 pub gcs_system_id: u8,
9277 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
9278 pub control_request: u8,
9279 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
9280 pub ack: u8,
9281}
9282impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
9283 pub const ENCODED_LEN: usize = 3usize;
9284 pub const DEFAULT: Self = Self {
9285 gcs_system_id: 0_u8,
9286 control_request: 0_u8,
9287 ack: 0_u8,
9288 };
9289 #[cfg(feature = "arbitrary")]
9290 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9291 use arbitrary::{Arbitrary, Unstructured};
9292 let mut buf = [0u8; 1024];
9293 rng.fill_bytes(&mut buf);
9294 let mut unstructured = Unstructured::new(&buf);
9295 Self::arbitrary(&mut unstructured).unwrap_or_default()
9296 }
9297}
9298impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
9299 fn default() -> Self {
9300 Self::DEFAULT.clone()
9301 }
9302}
9303impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
9304 type Message = MavMessage;
9305 const ID: u32 = 6u32;
9306 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
9307 const EXTRA_CRC: u8 = 104u8;
9308 const ENCODED_LEN: usize = 3usize;
9309 fn deser(
9310 _version: MavlinkVersion,
9311 __input: &[u8],
9312 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9313 let avail_len = __input.len();
9314 let mut payload_buf = [0; Self::ENCODED_LEN];
9315 let mut buf = if avail_len < Self::ENCODED_LEN {
9316 payload_buf[0..avail_len].copy_from_slice(__input);
9317 Bytes::new(&payload_buf)
9318 } else {
9319 Bytes::new(__input)
9320 };
9321 let mut __struct = Self::default();
9322 __struct.gcs_system_id = buf.get_u8();
9323 __struct.control_request = buf.get_u8();
9324 __struct.ack = buf.get_u8();
9325 Ok(__struct)
9326 }
9327 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9328 let mut __tmp = BytesMut::new(bytes);
9329 #[allow(clippy::absurd_extreme_comparisons)]
9330 #[allow(unused_comparisons)]
9331 if __tmp.remaining() < Self::ENCODED_LEN {
9332 panic!(
9333 "buffer is too small (need {} bytes, but got {})",
9334 Self::ENCODED_LEN,
9335 __tmp.remaining(),
9336 )
9337 }
9338 __tmp.put_u8(self.gcs_system_id);
9339 __tmp.put_u8(self.control_request);
9340 __tmp.put_u8(self.ack);
9341 if matches!(version, MavlinkVersion::V2) {
9342 let len = __tmp.len();
9343 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9344 } else {
9345 __tmp.len()
9346 }
9347 }
9348}
9349#[doc = "Information about a potential collision."]
9350#[doc = ""]
9351#[doc = "ID: 247"]
9352#[derive(Debug, Clone, PartialEq)]
9353#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9355#[cfg_attr(feature = "ts", derive(TS))]
9356#[cfg_attr(feature = "ts", ts(export))]
9357pub struct COLLISION_DATA {
9358 #[doc = "Unique identifier, domain based on src field"]
9359 pub id: u32,
9360 #[doc = "Estimated time until collision occurs"]
9361 pub time_to_minimum_delta: f32,
9362 #[doc = "Closest vertical distance between vehicle and object"]
9363 pub altitude_minimum_delta: f32,
9364 #[doc = "Closest horizontal distance between vehicle and object"]
9365 pub horizontal_minimum_delta: f32,
9366 #[doc = "Collision data source"]
9367 pub src: MavCollisionSrc,
9368 #[doc = "Action that is being taken to avoid this collision"]
9369 pub action: MavCollisionAction,
9370 #[doc = "How concerned the aircraft is about this collision"]
9371 pub threat_level: MavCollisionThreatLevel,
9372}
9373impl COLLISION_DATA {
9374 pub const ENCODED_LEN: usize = 19usize;
9375 pub const DEFAULT: Self = Self {
9376 id: 0_u32,
9377 time_to_minimum_delta: 0.0_f32,
9378 altitude_minimum_delta: 0.0_f32,
9379 horizontal_minimum_delta: 0.0_f32,
9380 src: MavCollisionSrc::DEFAULT,
9381 action: MavCollisionAction::DEFAULT,
9382 threat_level: MavCollisionThreatLevel::DEFAULT,
9383 };
9384 #[cfg(feature = "arbitrary")]
9385 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9386 use arbitrary::{Arbitrary, Unstructured};
9387 let mut buf = [0u8; 1024];
9388 rng.fill_bytes(&mut buf);
9389 let mut unstructured = Unstructured::new(&buf);
9390 Self::arbitrary(&mut unstructured).unwrap_or_default()
9391 }
9392}
9393impl Default for COLLISION_DATA {
9394 fn default() -> Self {
9395 Self::DEFAULT.clone()
9396 }
9397}
9398impl MessageData for COLLISION_DATA {
9399 type Message = MavMessage;
9400 const ID: u32 = 247u32;
9401 const NAME: &'static str = "COLLISION";
9402 const EXTRA_CRC: u8 = 81u8;
9403 const ENCODED_LEN: usize = 19usize;
9404 fn deser(
9405 _version: MavlinkVersion,
9406 __input: &[u8],
9407 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9408 let avail_len = __input.len();
9409 let mut payload_buf = [0; Self::ENCODED_LEN];
9410 let mut buf = if avail_len < Self::ENCODED_LEN {
9411 payload_buf[0..avail_len].copy_from_slice(__input);
9412 Bytes::new(&payload_buf)
9413 } else {
9414 Bytes::new(__input)
9415 };
9416 let mut __struct = Self::default();
9417 __struct.id = buf.get_u32_le();
9418 __struct.time_to_minimum_delta = buf.get_f32_le();
9419 __struct.altitude_minimum_delta = buf.get_f32_le();
9420 __struct.horizontal_minimum_delta = buf.get_f32_le();
9421 let tmp = buf.get_u8();
9422 __struct.src =
9423 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9424 enum_type: "MavCollisionSrc",
9425 value: tmp as u32,
9426 })?;
9427 let tmp = buf.get_u8();
9428 __struct.action =
9429 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9430 enum_type: "MavCollisionAction",
9431 value: tmp as u32,
9432 })?;
9433 let tmp = buf.get_u8();
9434 __struct.threat_level =
9435 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9436 enum_type: "MavCollisionThreatLevel",
9437 value: tmp as u32,
9438 })?;
9439 Ok(__struct)
9440 }
9441 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9442 let mut __tmp = BytesMut::new(bytes);
9443 #[allow(clippy::absurd_extreme_comparisons)]
9444 #[allow(unused_comparisons)]
9445 if __tmp.remaining() < Self::ENCODED_LEN {
9446 panic!(
9447 "buffer is too small (need {} bytes, but got {})",
9448 Self::ENCODED_LEN,
9449 __tmp.remaining(),
9450 )
9451 }
9452 __tmp.put_u32_le(self.id);
9453 __tmp.put_f32_le(self.time_to_minimum_delta);
9454 __tmp.put_f32_le(self.altitude_minimum_delta);
9455 __tmp.put_f32_le(self.horizontal_minimum_delta);
9456 __tmp.put_u8(self.src as u8);
9457 __tmp.put_u8(self.action as u8);
9458 __tmp.put_u8(self.threat_level as u8);
9459 if matches!(version, MavlinkVersion::V2) {
9460 let len = __tmp.len();
9461 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9462 } else {
9463 __tmp.len()
9464 }
9465 }
9466}
9467#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9468#[doc = ""]
9469#[doc = "ID: 77"]
9470#[derive(Debug, Clone, PartialEq)]
9471#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9472#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9473#[cfg_attr(feature = "ts", derive(TS))]
9474#[cfg_attr(feature = "ts", ts(export))]
9475pub struct COMMAND_ACK_DATA {
9476 #[doc = "Command ID (of acknowledged command)."]
9477 pub command: MavCmd,
9478 #[doc = "Result of command."]
9479 pub result: MavResult,
9480 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
9481 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9482 pub progress: u8,
9483 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
9484 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9485 pub result_param2: i32,
9486 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9487 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9488 pub target_system: u8,
9489 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9490 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9491 pub target_component: u8,
9492}
9493impl COMMAND_ACK_DATA {
9494 pub const ENCODED_LEN: usize = 10usize;
9495 pub const DEFAULT: Self = Self {
9496 command: MavCmd::DEFAULT,
9497 result: MavResult::DEFAULT,
9498 progress: 0_u8,
9499 result_param2: 0_i32,
9500 target_system: 0_u8,
9501 target_component: 0_u8,
9502 };
9503 #[cfg(feature = "arbitrary")]
9504 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9505 use arbitrary::{Arbitrary, Unstructured};
9506 let mut buf = [0u8; 1024];
9507 rng.fill_bytes(&mut buf);
9508 let mut unstructured = Unstructured::new(&buf);
9509 Self::arbitrary(&mut unstructured).unwrap_or_default()
9510 }
9511}
9512impl Default for COMMAND_ACK_DATA {
9513 fn default() -> Self {
9514 Self::DEFAULT.clone()
9515 }
9516}
9517impl MessageData for COMMAND_ACK_DATA {
9518 type Message = MavMessage;
9519 const ID: u32 = 77u32;
9520 const NAME: &'static str = "COMMAND_ACK";
9521 const EXTRA_CRC: u8 = 143u8;
9522 const ENCODED_LEN: usize = 10usize;
9523 fn deser(
9524 _version: MavlinkVersion,
9525 __input: &[u8],
9526 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9527 let avail_len = __input.len();
9528 let mut payload_buf = [0; Self::ENCODED_LEN];
9529 let mut buf = if avail_len < Self::ENCODED_LEN {
9530 payload_buf[0..avail_len].copy_from_slice(__input);
9531 Bytes::new(&payload_buf)
9532 } else {
9533 Bytes::new(__input)
9534 };
9535 let mut __struct = Self::default();
9536 let tmp = buf.get_u16_le();
9537 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9538 ::mavlink_core::error::ParserError::InvalidEnum {
9539 enum_type: "MavCmd",
9540 value: tmp as u32,
9541 },
9542 )?;
9543 let tmp = buf.get_u8();
9544 __struct.result =
9545 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9546 enum_type: "MavResult",
9547 value: tmp as u32,
9548 })?;
9549 __struct.progress = buf.get_u8();
9550 __struct.result_param2 = buf.get_i32_le();
9551 __struct.target_system = buf.get_u8();
9552 __struct.target_component = buf.get_u8();
9553 Ok(__struct)
9554 }
9555 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9556 let mut __tmp = BytesMut::new(bytes);
9557 #[allow(clippy::absurd_extreme_comparisons)]
9558 #[allow(unused_comparisons)]
9559 if __tmp.remaining() < Self::ENCODED_LEN {
9560 panic!(
9561 "buffer is too small (need {} bytes, but got {})",
9562 Self::ENCODED_LEN,
9563 __tmp.remaining(),
9564 )
9565 }
9566 __tmp.put_u16_le(self.command as u16);
9567 __tmp.put_u8(self.result as u8);
9568 if matches!(version, MavlinkVersion::V2) {
9569 __tmp.put_u8(self.progress);
9570 __tmp.put_i32_le(self.result_param2);
9571 __tmp.put_u8(self.target_system);
9572 __tmp.put_u8(self.target_component);
9573 let len = __tmp.len();
9574 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9575 } else {
9576 __tmp.len()
9577 }
9578 }
9579}
9580#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9581#[doc = ""]
9582#[doc = "ID: 80"]
9583#[derive(Debug, Clone, PartialEq)]
9584#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9585#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9586#[cfg_attr(feature = "ts", derive(TS))]
9587#[cfg_attr(feature = "ts", ts(export))]
9588pub struct COMMAND_CANCEL_DATA {
9589 #[doc = "Command ID (of command to cancel)."]
9590 pub command: MavCmd,
9591 #[doc = "System executing long running command. Should not be broadcast (0)."]
9592 pub target_system: u8,
9593 #[doc = "Component executing long running command."]
9594 pub target_component: u8,
9595}
9596impl COMMAND_CANCEL_DATA {
9597 pub const ENCODED_LEN: usize = 4usize;
9598 pub const DEFAULT: Self = Self {
9599 command: MavCmd::DEFAULT,
9600 target_system: 0_u8,
9601 target_component: 0_u8,
9602 };
9603 #[cfg(feature = "arbitrary")]
9604 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9605 use arbitrary::{Arbitrary, Unstructured};
9606 let mut buf = [0u8; 1024];
9607 rng.fill_bytes(&mut buf);
9608 let mut unstructured = Unstructured::new(&buf);
9609 Self::arbitrary(&mut unstructured).unwrap_or_default()
9610 }
9611}
9612impl Default for COMMAND_CANCEL_DATA {
9613 fn default() -> Self {
9614 Self::DEFAULT.clone()
9615 }
9616}
9617impl MessageData for COMMAND_CANCEL_DATA {
9618 type Message = MavMessage;
9619 const ID: u32 = 80u32;
9620 const NAME: &'static str = "COMMAND_CANCEL";
9621 const EXTRA_CRC: u8 = 14u8;
9622 const ENCODED_LEN: usize = 4usize;
9623 fn deser(
9624 _version: MavlinkVersion,
9625 __input: &[u8],
9626 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9627 let avail_len = __input.len();
9628 let mut payload_buf = [0; Self::ENCODED_LEN];
9629 let mut buf = if avail_len < Self::ENCODED_LEN {
9630 payload_buf[0..avail_len].copy_from_slice(__input);
9631 Bytes::new(&payload_buf)
9632 } else {
9633 Bytes::new(__input)
9634 };
9635 let mut __struct = Self::default();
9636 let tmp = buf.get_u16_le();
9637 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9638 ::mavlink_core::error::ParserError::InvalidEnum {
9639 enum_type: "MavCmd",
9640 value: tmp as u32,
9641 },
9642 )?;
9643 __struct.target_system = buf.get_u8();
9644 __struct.target_component = buf.get_u8();
9645 Ok(__struct)
9646 }
9647 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9648 let mut __tmp = BytesMut::new(bytes);
9649 #[allow(clippy::absurd_extreme_comparisons)]
9650 #[allow(unused_comparisons)]
9651 if __tmp.remaining() < Self::ENCODED_LEN {
9652 panic!(
9653 "buffer is too small (need {} bytes, but got {})",
9654 Self::ENCODED_LEN,
9655 __tmp.remaining(),
9656 )
9657 }
9658 __tmp.put_u16_le(self.command as u16);
9659 __tmp.put_u8(self.target_system);
9660 __tmp.put_u8(self.target_component);
9661 if matches!(version, MavlinkVersion::V2) {
9662 let len = __tmp.len();
9663 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9664 } else {
9665 __tmp.len()
9666 }
9667 }
9668}
9669#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9670#[doc = ""]
9671#[doc = "ID: 75"]
9672#[derive(Debug, Clone, PartialEq)]
9673#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9675#[cfg_attr(feature = "ts", derive(TS))]
9676#[cfg_attr(feature = "ts", ts(export))]
9677pub struct COMMAND_INT_DATA {
9678 #[doc = "PARAM1, see MAV_CMD enum"]
9679 pub param1: f32,
9680 #[doc = "PARAM2, see MAV_CMD enum"]
9681 pub param2: f32,
9682 #[doc = "PARAM3, see MAV_CMD enum"]
9683 pub param3: f32,
9684 #[doc = "PARAM4, see MAV_CMD enum"]
9685 pub param4: f32,
9686 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9687 pub x: i32,
9688 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9689 pub y: i32,
9690 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9691 pub z: f32,
9692 #[doc = "The scheduled action for the mission item."]
9693 pub command: MavCmd,
9694 #[doc = "System ID"]
9695 pub target_system: u8,
9696 #[doc = "Component ID"]
9697 pub target_component: u8,
9698 #[doc = "The coordinate system of the COMMAND."]
9699 pub frame: MavFrame,
9700 #[doc = "Not used."]
9701 pub current: u8,
9702 #[doc = "Not used (set 0)."]
9703 pub autocontinue: u8,
9704}
9705impl COMMAND_INT_DATA {
9706 pub const ENCODED_LEN: usize = 35usize;
9707 pub const DEFAULT: Self = Self {
9708 param1: 0.0_f32,
9709 param2: 0.0_f32,
9710 param3: 0.0_f32,
9711 param4: 0.0_f32,
9712 x: 0_i32,
9713 y: 0_i32,
9714 z: 0.0_f32,
9715 command: MavCmd::DEFAULT,
9716 target_system: 0_u8,
9717 target_component: 0_u8,
9718 frame: MavFrame::DEFAULT,
9719 current: 0_u8,
9720 autocontinue: 0_u8,
9721 };
9722 #[cfg(feature = "arbitrary")]
9723 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9724 use arbitrary::{Arbitrary, Unstructured};
9725 let mut buf = [0u8; 1024];
9726 rng.fill_bytes(&mut buf);
9727 let mut unstructured = Unstructured::new(&buf);
9728 Self::arbitrary(&mut unstructured).unwrap_or_default()
9729 }
9730}
9731impl Default for COMMAND_INT_DATA {
9732 fn default() -> Self {
9733 Self::DEFAULT.clone()
9734 }
9735}
9736impl MessageData for COMMAND_INT_DATA {
9737 type Message = MavMessage;
9738 const ID: u32 = 75u32;
9739 const NAME: &'static str = "COMMAND_INT";
9740 const EXTRA_CRC: u8 = 158u8;
9741 const ENCODED_LEN: usize = 35usize;
9742 fn deser(
9743 _version: MavlinkVersion,
9744 __input: &[u8],
9745 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9746 let avail_len = __input.len();
9747 let mut payload_buf = [0; Self::ENCODED_LEN];
9748 let mut buf = if avail_len < Self::ENCODED_LEN {
9749 payload_buf[0..avail_len].copy_from_slice(__input);
9750 Bytes::new(&payload_buf)
9751 } else {
9752 Bytes::new(__input)
9753 };
9754 let mut __struct = Self::default();
9755 __struct.param1 = buf.get_f32_le();
9756 __struct.param2 = buf.get_f32_le();
9757 __struct.param3 = buf.get_f32_le();
9758 __struct.param4 = buf.get_f32_le();
9759 __struct.x = buf.get_i32_le();
9760 __struct.y = buf.get_i32_le();
9761 __struct.z = buf.get_f32_le();
9762 let tmp = buf.get_u16_le();
9763 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9764 ::mavlink_core::error::ParserError::InvalidEnum {
9765 enum_type: "MavCmd",
9766 value: tmp as u32,
9767 },
9768 )?;
9769 __struct.target_system = buf.get_u8();
9770 __struct.target_component = buf.get_u8();
9771 let tmp = buf.get_u8();
9772 __struct.frame =
9773 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9774 enum_type: "MavFrame",
9775 value: tmp as u32,
9776 })?;
9777 __struct.current = buf.get_u8();
9778 __struct.autocontinue = buf.get_u8();
9779 Ok(__struct)
9780 }
9781 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9782 let mut __tmp = BytesMut::new(bytes);
9783 #[allow(clippy::absurd_extreme_comparisons)]
9784 #[allow(unused_comparisons)]
9785 if __tmp.remaining() < Self::ENCODED_LEN {
9786 panic!(
9787 "buffer is too small (need {} bytes, but got {})",
9788 Self::ENCODED_LEN,
9789 __tmp.remaining(),
9790 )
9791 }
9792 __tmp.put_f32_le(self.param1);
9793 __tmp.put_f32_le(self.param2);
9794 __tmp.put_f32_le(self.param3);
9795 __tmp.put_f32_le(self.param4);
9796 __tmp.put_i32_le(self.x);
9797 __tmp.put_i32_le(self.y);
9798 __tmp.put_f32_le(self.z);
9799 __tmp.put_u16_le(self.command as u16);
9800 __tmp.put_u8(self.target_system);
9801 __tmp.put_u8(self.target_component);
9802 __tmp.put_u8(self.frame as u8);
9803 __tmp.put_u8(self.current);
9804 __tmp.put_u8(self.autocontinue);
9805 if matches!(version, MavlinkVersion::V2) {
9806 let len = __tmp.len();
9807 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9808 } else {
9809 __tmp.len()
9810 }
9811 }
9812}
9813#[doc = "Message encoding a command with parameters as scaled integers and additional metadata. Scaling depends on the actual command value."]
9814#[doc = ""]
9815#[doc = "ID: 223"]
9816#[derive(Debug, Clone, PartialEq)]
9817#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9818#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9819#[cfg_attr(feature = "ts", derive(TS))]
9820#[cfg_attr(feature = "ts", ts(export))]
9821pub struct COMMAND_INT_STAMPED_DATA {
9822 #[doc = "Microseconds elapsed since vehicle boot"]
9823 pub vehicle_timestamp: u64,
9824 #[doc = "UTC time, seconds elapsed since 01.01.1970"]
9825 pub utc_time: u32,
9826 #[doc = "PARAM1, see MAV_CMD enum"]
9827 pub param1: f32,
9828 #[doc = "PARAM2, see MAV_CMD enum"]
9829 pub param2: f32,
9830 #[doc = "PARAM3, see MAV_CMD enum"]
9831 pub param3: f32,
9832 #[doc = "PARAM4, see MAV_CMD enum"]
9833 pub param4: f32,
9834 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9835 pub x: i32,
9836 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9837 pub y: i32,
9838 #[doc = "PARAM7 / z position: global: altitude in meters (MSL, WGS84, AGL or relative to home - depending on frame)."]
9839 pub z: f32,
9840 #[doc = "The scheduled action for the mission item, as defined by MAV_CMD enum"]
9841 pub command: MavCmd,
9842 #[doc = "System ID"]
9843 pub target_system: u8,
9844 #[doc = "Component ID"]
9845 pub target_component: u8,
9846 #[doc = "The coordinate system of the COMMAND, as defined by MAV_FRAME enum"]
9847 pub frame: MavFrame,
9848 #[doc = "false:0, true:1"]
9849 pub current: u8,
9850 #[doc = "autocontinue to next wp"]
9851 pub autocontinue: u8,
9852}
9853impl COMMAND_INT_STAMPED_DATA {
9854 pub const ENCODED_LEN: usize = 47usize;
9855 pub const DEFAULT: Self = Self {
9856 vehicle_timestamp: 0_u64,
9857 utc_time: 0_u32,
9858 param1: 0.0_f32,
9859 param2: 0.0_f32,
9860 param3: 0.0_f32,
9861 param4: 0.0_f32,
9862 x: 0_i32,
9863 y: 0_i32,
9864 z: 0.0_f32,
9865 command: MavCmd::DEFAULT,
9866 target_system: 0_u8,
9867 target_component: 0_u8,
9868 frame: MavFrame::DEFAULT,
9869 current: 0_u8,
9870 autocontinue: 0_u8,
9871 };
9872 #[cfg(feature = "arbitrary")]
9873 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9874 use arbitrary::{Arbitrary, Unstructured};
9875 let mut buf = [0u8; 1024];
9876 rng.fill_bytes(&mut buf);
9877 let mut unstructured = Unstructured::new(&buf);
9878 Self::arbitrary(&mut unstructured).unwrap_or_default()
9879 }
9880}
9881impl Default for COMMAND_INT_STAMPED_DATA {
9882 fn default() -> Self {
9883 Self::DEFAULT.clone()
9884 }
9885}
9886impl MessageData for COMMAND_INT_STAMPED_DATA {
9887 type Message = MavMessage;
9888 const ID: u32 = 223u32;
9889 const NAME: &'static str = "COMMAND_INT_STAMPED";
9890 const EXTRA_CRC: u8 = 119u8;
9891 const ENCODED_LEN: usize = 47usize;
9892 fn deser(
9893 _version: MavlinkVersion,
9894 __input: &[u8],
9895 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9896 let avail_len = __input.len();
9897 let mut payload_buf = [0; Self::ENCODED_LEN];
9898 let mut buf = if avail_len < Self::ENCODED_LEN {
9899 payload_buf[0..avail_len].copy_from_slice(__input);
9900 Bytes::new(&payload_buf)
9901 } else {
9902 Bytes::new(__input)
9903 };
9904 let mut __struct = Self::default();
9905 __struct.vehicle_timestamp = buf.get_u64_le();
9906 __struct.utc_time = buf.get_u32_le();
9907 __struct.param1 = buf.get_f32_le();
9908 __struct.param2 = buf.get_f32_le();
9909 __struct.param3 = buf.get_f32_le();
9910 __struct.param4 = buf.get_f32_le();
9911 __struct.x = buf.get_i32_le();
9912 __struct.y = buf.get_i32_le();
9913 __struct.z = buf.get_f32_le();
9914 let tmp = buf.get_u16_le();
9915 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9916 ::mavlink_core::error::ParserError::InvalidEnum {
9917 enum_type: "MavCmd",
9918 value: tmp as u32,
9919 },
9920 )?;
9921 __struct.target_system = buf.get_u8();
9922 __struct.target_component = buf.get_u8();
9923 let tmp = buf.get_u8();
9924 __struct.frame =
9925 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9926 enum_type: "MavFrame",
9927 value: tmp as u32,
9928 })?;
9929 __struct.current = buf.get_u8();
9930 __struct.autocontinue = buf.get_u8();
9931 Ok(__struct)
9932 }
9933 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9934 let mut __tmp = BytesMut::new(bytes);
9935 #[allow(clippy::absurd_extreme_comparisons)]
9936 #[allow(unused_comparisons)]
9937 if __tmp.remaining() < Self::ENCODED_LEN {
9938 panic!(
9939 "buffer is too small (need {} bytes, but got {})",
9940 Self::ENCODED_LEN,
9941 __tmp.remaining(),
9942 )
9943 }
9944 __tmp.put_u64_le(self.vehicle_timestamp);
9945 __tmp.put_u32_le(self.utc_time);
9946 __tmp.put_f32_le(self.param1);
9947 __tmp.put_f32_le(self.param2);
9948 __tmp.put_f32_le(self.param3);
9949 __tmp.put_f32_le(self.param4);
9950 __tmp.put_i32_le(self.x);
9951 __tmp.put_i32_le(self.y);
9952 __tmp.put_f32_le(self.z);
9953 __tmp.put_u16_le(self.command as u16);
9954 __tmp.put_u8(self.target_system);
9955 __tmp.put_u8(self.target_component);
9956 __tmp.put_u8(self.frame as u8);
9957 __tmp.put_u8(self.current);
9958 __tmp.put_u8(self.autocontinue);
9959 if matches!(version, MavlinkVersion::V2) {
9960 let len = __tmp.len();
9961 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9962 } else {
9963 __tmp.len()
9964 }
9965 }
9966}
9967#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9968#[doc = ""]
9969#[doc = "ID: 76"]
9970#[derive(Debug, Clone, PartialEq)]
9971#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9972#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9973#[cfg_attr(feature = "ts", derive(TS))]
9974#[cfg_attr(feature = "ts", ts(export))]
9975pub struct COMMAND_LONG_DATA {
9976 #[doc = "Parameter 1 (for the specific command)."]
9977 pub param1: f32,
9978 #[doc = "Parameter 2 (for the specific command)."]
9979 pub param2: f32,
9980 #[doc = "Parameter 3 (for the specific command)."]
9981 pub param3: f32,
9982 #[doc = "Parameter 4 (for the specific command)."]
9983 pub param4: f32,
9984 #[doc = "Parameter 5 (for the specific command)."]
9985 pub param5: f32,
9986 #[doc = "Parameter 6 (for the specific command)."]
9987 pub param6: f32,
9988 #[doc = "Parameter 7 (for the specific command)."]
9989 pub param7: f32,
9990 #[doc = "Command ID (of command to send)."]
9991 pub command: MavCmd,
9992 #[doc = "System which should execute the command"]
9993 pub target_system: u8,
9994 #[doc = "Component which should execute the command, 0 for all components"]
9995 pub target_component: u8,
9996 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9997 pub confirmation: u8,
9998}
9999impl COMMAND_LONG_DATA {
10000 pub const ENCODED_LEN: usize = 33usize;
10001 pub const DEFAULT: Self = Self {
10002 param1: 0.0_f32,
10003 param2: 0.0_f32,
10004 param3: 0.0_f32,
10005 param4: 0.0_f32,
10006 param5: 0.0_f32,
10007 param6: 0.0_f32,
10008 param7: 0.0_f32,
10009 command: MavCmd::DEFAULT,
10010 target_system: 0_u8,
10011 target_component: 0_u8,
10012 confirmation: 0_u8,
10013 };
10014 #[cfg(feature = "arbitrary")]
10015 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10016 use arbitrary::{Arbitrary, Unstructured};
10017 let mut buf = [0u8; 1024];
10018 rng.fill_bytes(&mut buf);
10019 let mut unstructured = Unstructured::new(&buf);
10020 Self::arbitrary(&mut unstructured).unwrap_or_default()
10021 }
10022}
10023impl Default for COMMAND_LONG_DATA {
10024 fn default() -> Self {
10025 Self::DEFAULT.clone()
10026 }
10027}
10028impl MessageData for COMMAND_LONG_DATA {
10029 type Message = MavMessage;
10030 const ID: u32 = 76u32;
10031 const NAME: &'static str = "COMMAND_LONG";
10032 const EXTRA_CRC: u8 = 152u8;
10033 const ENCODED_LEN: usize = 33usize;
10034 fn deser(
10035 _version: MavlinkVersion,
10036 __input: &[u8],
10037 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10038 let avail_len = __input.len();
10039 let mut payload_buf = [0; Self::ENCODED_LEN];
10040 let mut buf = if avail_len < Self::ENCODED_LEN {
10041 payload_buf[0..avail_len].copy_from_slice(__input);
10042 Bytes::new(&payload_buf)
10043 } else {
10044 Bytes::new(__input)
10045 };
10046 let mut __struct = Self::default();
10047 __struct.param1 = buf.get_f32_le();
10048 __struct.param2 = buf.get_f32_le();
10049 __struct.param3 = buf.get_f32_le();
10050 __struct.param4 = buf.get_f32_le();
10051 __struct.param5 = buf.get_f32_le();
10052 __struct.param6 = buf.get_f32_le();
10053 __struct.param7 = buf.get_f32_le();
10054 let tmp = buf.get_u16_le();
10055 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
10056 ::mavlink_core::error::ParserError::InvalidEnum {
10057 enum_type: "MavCmd",
10058 value: tmp as u32,
10059 },
10060 )?;
10061 __struct.target_system = buf.get_u8();
10062 __struct.target_component = buf.get_u8();
10063 __struct.confirmation = buf.get_u8();
10064 Ok(__struct)
10065 }
10066 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10067 let mut __tmp = BytesMut::new(bytes);
10068 #[allow(clippy::absurd_extreme_comparisons)]
10069 #[allow(unused_comparisons)]
10070 if __tmp.remaining() < Self::ENCODED_LEN {
10071 panic!(
10072 "buffer is too small (need {} bytes, but got {})",
10073 Self::ENCODED_LEN,
10074 __tmp.remaining(),
10075 )
10076 }
10077 __tmp.put_f32_le(self.param1);
10078 __tmp.put_f32_le(self.param2);
10079 __tmp.put_f32_le(self.param3);
10080 __tmp.put_f32_le(self.param4);
10081 __tmp.put_f32_le(self.param5);
10082 __tmp.put_f32_le(self.param6);
10083 __tmp.put_f32_le(self.param7);
10084 __tmp.put_u16_le(self.command as u16);
10085 __tmp.put_u8(self.target_system);
10086 __tmp.put_u8(self.target_component);
10087 __tmp.put_u8(self.confirmation);
10088 if matches!(version, MavlinkVersion::V2) {
10089 let len = __tmp.len();
10090 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10091 } else {
10092 __tmp.len()
10093 }
10094 }
10095}
10096#[doc = "Send a command with up to seven parameters to the MAV and additional metadata."]
10097#[doc = ""]
10098#[doc = "ID: 224"]
10099#[derive(Debug, Clone, PartialEq)]
10100#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10101#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10102#[cfg_attr(feature = "ts", derive(TS))]
10103#[cfg_attr(feature = "ts", ts(export))]
10104pub struct COMMAND_LONG_STAMPED_DATA {
10105 #[doc = "Microseconds elapsed since vehicle boot"]
10106 pub vehicle_timestamp: u64,
10107 #[doc = "UTC time, seconds elapsed since 01.01.1970"]
10108 pub utc_time: u32,
10109 #[doc = "Parameter 1, as defined by MAV_CMD enum."]
10110 pub param1: f32,
10111 #[doc = "Parameter 2, as defined by MAV_CMD enum."]
10112 pub param2: f32,
10113 #[doc = "Parameter 3, as defined by MAV_CMD enum."]
10114 pub param3: f32,
10115 #[doc = "Parameter 4, as defined by MAV_CMD enum."]
10116 pub param4: f32,
10117 #[doc = "Parameter 5, as defined by MAV_CMD enum."]
10118 pub param5: f32,
10119 #[doc = "Parameter 6, as defined by MAV_CMD enum."]
10120 pub param6: f32,
10121 #[doc = "Parameter 7, as defined by MAV_CMD enum."]
10122 pub param7: f32,
10123 #[doc = "Command ID, as defined by MAV_CMD enum."]
10124 pub command: MavCmd,
10125 #[doc = "System which should execute the command"]
10126 pub target_system: u8,
10127 #[doc = "Component which should execute the command, 0 for all components"]
10128 pub target_component: u8,
10129 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
10130 pub confirmation: u8,
10131}
10132impl COMMAND_LONG_STAMPED_DATA {
10133 pub const ENCODED_LEN: usize = 45usize;
10134 pub const DEFAULT: Self = Self {
10135 vehicle_timestamp: 0_u64,
10136 utc_time: 0_u32,
10137 param1: 0.0_f32,
10138 param2: 0.0_f32,
10139 param3: 0.0_f32,
10140 param4: 0.0_f32,
10141 param5: 0.0_f32,
10142 param6: 0.0_f32,
10143 param7: 0.0_f32,
10144 command: MavCmd::DEFAULT,
10145 target_system: 0_u8,
10146 target_component: 0_u8,
10147 confirmation: 0_u8,
10148 };
10149 #[cfg(feature = "arbitrary")]
10150 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10151 use arbitrary::{Arbitrary, Unstructured};
10152 let mut buf = [0u8; 1024];
10153 rng.fill_bytes(&mut buf);
10154 let mut unstructured = Unstructured::new(&buf);
10155 Self::arbitrary(&mut unstructured).unwrap_or_default()
10156 }
10157}
10158impl Default for COMMAND_LONG_STAMPED_DATA {
10159 fn default() -> Self {
10160 Self::DEFAULT.clone()
10161 }
10162}
10163impl MessageData for COMMAND_LONG_STAMPED_DATA {
10164 type Message = MavMessage;
10165 const ID: u32 = 224u32;
10166 const NAME: &'static str = "COMMAND_LONG_STAMPED";
10167 const EXTRA_CRC: u8 = 102u8;
10168 const ENCODED_LEN: usize = 45usize;
10169 fn deser(
10170 _version: MavlinkVersion,
10171 __input: &[u8],
10172 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10173 let avail_len = __input.len();
10174 let mut payload_buf = [0; Self::ENCODED_LEN];
10175 let mut buf = if avail_len < Self::ENCODED_LEN {
10176 payload_buf[0..avail_len].copy_from_slice(__input);
10177 Bytes::new(&payload_buf)
10178 } else {
10179 Bytes::new(__input)
10180 };
10181 let mut __struct = Self::default();
10182 __struct.vehicle_timestamp = buf.get_u64_le();
10183 __struct.utc_time = buf.get_u32_le();
10184 __struct.param1 = buf.get_f32_le();
10185 __struct.param2 = buf.get_f32_le();
10186 __struct.param3 = buf.get_f32_le();
10187 __struct.param4 = buf.get_f32_le();
10188 __struct.param5 = buf.get_f32_le();
10189 __struct.param6 = buf.get_f32_le();
10190 __struct.param7 = buf.get_f32_le();
10191 let tmp = buf.get_u16_le();
10192 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
10193 ::mavlink_core::error::ParserError::InvalidEnum {
10194 enum_type: "MavCmd",
10195 value: tmp as u32,
10196 },
10197 )?;
10198 __struct.target_system = buf.get_u8();
10199 __struct.target_component = buf.get_u8();
10200 __struct.confirmation = buf.get_u8();
10201 Ok(__struct)
10202 }
10203 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10204 let mut __tmp = BytesMut::new(bytes);
10205 #[allow(clippy::absurd_extreme_comparisons)]
10206 #[allow(unused_comparisons)]
10207 if __tmp.remaining() < Self::ENCODED_LEN {
10208 panic!(
10209 "buffer is too small (need {} bytes, but got {})",
10210 Self::ENCODED_LEN,
10211 __tmp.remaining(),
10212 )
10213 }
10214 __tmp.put_u64_le(self.vehicle_timestamp);
10215 __tmp.put_u32_le(self.utc_time);
10216 __tmp.put_f32_le(self.param1);
10217 __tmp.put_f32_le(self.param2);
10218 __tmp.put_f32_le(self.param3);
10219 __tmp.put_f32_le(self.param4);
10220 __tmp.put_f32_le(self.param5);
10221 __tmp.put_f32_le(self.param6);
10222 __tmp.put_f32_le(self.param7);
10223 __tmp.put_u16_le(self.command as u16);
10224 __tmp.put_u8(self.target_system);
10225 __tmp.put_u8(self.target_component);
10226 __tmp.put_u8(self.confirmation);
10227 if matches!(version, MavlinkVersion::V2) {
10228 let len = __tmp.len();
10229 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10230 } else {
10231 __tmp.len()
10232 }
10233 }
10234}
10235#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
10236#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
10237#[doc = ""]
10238#[doc = "ID: 395"]
10239#[derive(Debug, Clone, PartialEq)]
10240#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10241#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10242#[cfg_attr(feature = "ts", derive(TS))]
10243#[cfg_attr(feature = "ts", ts(export))]
10244pub struct COMPONENT_INFORMATION_DATA {
10245 #[doc = "Timestamp (time since system boot)."]
10246 pub time_boot_ms: u32,
10247 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
10248 pub general_metadata_file_crc: u32,
10249 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
10250 pub peripherals_metadata_file_crc: u32,
10251 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
10252 #[cfg_attr(feature = "ts", ts(type = "string"))]
10253 pub general_metadata_uri: CharArray<100>,
10254 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
10255 #[cfg_attr(feature = "ts", ts(type = "string"))]
10256 pub peripherals_metadata_uri: CharArray<100>,
10257}
10258impl COMPONENT_INFORMATION_DATA {
10259 pub const ENCODED_LEN: usize = 212usize;
10260 pub const DEFAULT: Self = Self {
10261 time_boot_ms: 0_u32,
10262 general_metadata_file_crc: 0_u32,
10263 peripherals_metadata_file_crc: 0_u32,
10264 general_metadata_uri: CharArray::new([0_u8; 100usize]),
10265 peripherals_metadata_uri: CharArray::new([0_u8; 100usize]),
10266 };
10267 #[cfg(feature = "arbitrary")]
10268 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10269 use arbitrary::{Arbitrary, Unstructured};
10270 let mut buf = [0u8; 1024];
10271 rng.fill_bytes(&mut buf);
10272 let mut unstructured = Unstructured::new(&buf);
10273 Self::arbitrary(&mut unstructured).unwrap_or_default()
10274 }
10275}
10276impl Default for COMPONENT_INFORMATION_DATA {
10277 fn default() -> Self {
10278 Self::DEFAULT.clone()
10279 }
10280}
10281impl MessageData for COMPONENT_INFORMATION_DATA {
10282 type Message = MavMessage;
10283 const ID: u32 = 395u32;
10284 const NAME: &'static str = "COMPONENT_INFORMATION";
10285 const EXTRA_CRC: u8 = 0u8;
10286 const ENCODED_LEN: usize = 212usize;
10287 fn deser(
10288 _version: MavlinkVersion,
10289 __input: &[u8],
10290 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10291 let avail_len = __input.len();
10292 let mut payload_buf = [0; Self::ENCODED_LEN];
10293 let mut buf = if avail_len < Self::ENCODED_LEN {
10294 payload_buf[0..avail_len].copy_from_slice(__input);
10295 Bytes::new(&payload_buf)
10296 } else {
10297 Bytes::new(__input)
10298 };
10299 let mut __struct = Self::default();
10300 __struct.time_boot_ms = buf.get_u32_le();
10301 __struct.general_metadata_file_crc = buf.get_u32_le();
10302 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
10303 let mut tmp = [0_u8; 100usize];
10304 for v in &mut tmp {
10305 *v = buf.get_u8();
10306 }
10307 __struct.general_metadata_uri = CharArray::new(tmp);
10308 let mut tmp = [0_u8; 100usize];
10309 for v in &mut tmp {
10310 *v = buf.get_u8();
10311 }
10312 __struct.peripherals_metadata_uri = CharArray::new(tmp);
10313 Ok(__struct)
10314 }
10315 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10316 let mut __tmp = BytesMut::new(bytes);
10317 #[allow(clippy::absurd_extreme_comparisons)]
10318 #[allow(unused_comparisons)]
10319 if __tmp.remaining() < Self::ENCODED_LEN {
10320 panic!(
10321 "buffer is too small (need {} bytes, but got {})",
10322 Self::ENCODED_LEN,
10323 __tmp.remaining(),
10324 )
10325 }
10326 __tmp.put_u32_le(self.time_boot_ms);
10327 __tmp.put_u32_le(self.general_metadata_file_crc);
10328 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
10329 for val in &self.general_metadata_uri {
10330 __tmp.put_u8(*val);
10331 }
10332 for val in &self.peripherals_metadata_uri {
10333 __tmp.put_u8(*val);
10334 }
10335 if matches!(version, MavlinkVersion::V2) {
10336 let len = __tmp.len();
10337 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10338 } else {
10339 __tmp.len()
10340 }
10341 }
10342}
10343#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
10344#[doc = ""]
10345#[doc = "ID: 396"]
10346#[derive(Debug, Clone, PartialEq)]
10347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10348#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10349#[cfg_attr(feature = "ts", derive(TS))]
10350#[cfg_attr(feature = "ts", ts(export))]
10351pub struct COMPONENT_INFORMATION_BASIC_DATA {
10352 #[doc = "Component capability flags"]
10353 pub capabilities: MavProtocolCapability,
10354 #[doc = "Timestamp (time since system boot)."]
10355 pub time_boot_ms: u32,
10356 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
10357 pub time_manufacture_s: u32,
10358 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
10359 #[cfg_attr(feature = "ts", ts(type = "string"))]
10360 pub vendor_name: CharArray<32>,
10361 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
10362 #[cfg_attr(feature = "ts", ts(type = "string"))]
10363 pub model_name: CharArray<32>,
10364 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
10365 #[cfg_attr(feature = "ts", ts(type = "string"))]
10366 pub software_version: CharArray<24>,
10367 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
10368 #[cfg_attr(feature = "ts", ts(type = "string"))]
10369 pub hardware_version: CharArray<24>,
10370 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
10371 #[cfg_attr(feature = "ts", ts(type = "string"))]
10372 pub serial_number: CharArray<32>,
10373}
10374impl COMPONENT_INFORMATION_BASIC_DATA {
10375 pub const ENCODED_LEN: usize = 160usize;
10376 pub const DEFAULT: Self = Self {
10377 capabilities: MavProtocolCapability::DEFAULT,
10378 time_boot_ms: 0_u32,
10379 time_manufacture_s: 0_u32,
10380 vendor_name: CharArray::new([0_u8; 32usize]),
10381 model_name: CharArray::new([0_u8; 32usize]),
10382 software_version: CharArray::new([0_u8; 24usize]),
10383 hardware_version: CharArray::new([0_u8; 24usize]),
10384 serial_number: CharArray::new([0_u8; 32usize]),
10385 };
10386 #[cfg(feature = "arbitrary")]
10387 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10388 use arbitrary::{Arbitrary, Unstructured};
10389 let mut buf = [0u8; 1024];
10390 rng.fill_bytes(&mut buf);
10391 let mut unstructured = Unstructured::new(&buf);
10392 Self::arbitrary(&mut unstructured).unwrap_or_default()
10393 }
10394}
10395impl Default for COMPONENT_INFORMATION_BASIC_DATA {
10396 fn default() -> Self {
10397 Self::DEFAULT.clone()
10398 }
10399}
10400impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
10401 type Message = MavMessage;
10402 const ID: u32 = 396u32;
10403 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
10404 const EXTRA_CRC: u8 = 50u8;
10405 const ENCODED_LEN: usize = 160usize;
10406 fn deser(
10407 _version: MavlinkVersion,
10408 __input: &[u8],
10409 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10410 let avail_len = __input.len();
10411 let mut payload_buf = [0; Self::ENCODED_LEN];
10412 let mut buf = if avail_len < Self::ENCODED_LEN {
10413 payload_buf[0..avail_len].copy_from_slice(__input);
10414 Bytes::new(&payload_buf)
10415 } else {
10416 Bytes::new(__input)
10417 };
10418 let mut __struct = Self::default();
10419 let tmp = buf.get_u64_le();
10420 __struct.capabilities = MavProtocolCapability::from_bits(
10421 tmp & MavProtocolCapability::all().bits(),
10422 )
10423 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
10424 flag_type: "MavProtocolCapability",
10425 value: tmp as u32,
10426 })?;
10427 __struct.time_boot_ms = buf.get_u32_le();
10428 __struct.time_manufacture_s = buf.get_u32_le();
10429 let mut tmp = [0_u8; 32usize];
10430 for v in &mut tmp {
10431 *v = buf.get_u8();
10432 }
10433 __struct.vendor_name = CharArray::new(tmp);
10434 let mut tmp = [0_u8; 32usize];
10435 for v in &mut tmp {
10436 *v = buf.get_u8();
10437 }
10438 __struct.model_name = CharArray::new(tmp);
10439 let mut tmp = [0_u8; 24usize];
10440 for v in &mut tmp {
10441 *v = buf.get_u8();
10442 }
10443 __struct.software_version = CharArray::new(tmp);
10444 let mut tmp = [0_u8; 24usize];
10445 for v in &mut tmp {
10446 *v = buf.get_u8();
10447 }
10448 __struct.hardware_version = CharArray::new(tmp);
10449 let mut tmp = [0_u8; 32usize];
10450 for v in &mut tmp {
10451 *v = buf.get_u8();
10452 }
10453 __struct.serial_number = CharArray::new(tmp);
10454 Ok(__struct)
10455 }
10456 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10457 let mut __tmp = BytesMut::new(bytes);
10458 #[allow(clippy::absurd_extreme_comparisons)]
10459 #[allow(unused_comparisons)]
10460 if __tmp.remaining() < Self::ENCODED_LEN {
10461 panic!(
10462 "buffer is too small (need {} bytes, but got {})",
10463 Self::ENCODED_LEN,
10464 __tmp.remaining(),
10465 )
10466 }
10467 __tmp.put_u64_le(self.capabilities.bits());
10468 __tmp.put_u32_le(self.time_boot_ms);
10469 __tmp.put_u32_le(self.time_manufacture_s);
10470 for val in &self.vendor_name {
10471 __tmp.put_u8(*val);
10472 }
10473 for val in &self.model_name {
10474 __tmp.put_u8(*val);
10475 }
10476 for val in &self.software_version {
10477 __tmp.put_u8(*val);
10478 }
10479 for val in &self.hardware_version {
10480 __tmp.put_u8(*val);
10481 }
10482 for val in &self.serial_number {
10483 __tmp.put_u8(*val);
10484 }
10485 if matches!(version, MavlinkVersion::V2) {
10486 let len = __tmp.len();
10487 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10488 } else {
10489 __tmp.len()
10490 }
10491 }
10492}
10493#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
10494#[doc = ""]
10495#[doc = "ID: 397"]
10496#[derive(Debug, Clone, PartialEq)]
10497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10498#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10499#[cfg_attr(feature = "ts", derive(TS))]
10500#[cfg_attr(feature = "ts", ts(export))]
10501pub struct COMPONENT_METADATA_DATA {
10502 #[doc = "Timestamp (time since system boot)."]
10503 pub time_boot_ms: u32,
10504 #[doc = "CRC32 of the general metadata file."]
10505 pub file_crc: u32,
10506 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
10507 #[cfg_attr(feature = "ts", ts(type = "string"))]
10508 pub uri: CharArray<100>,
10509}
10510impl COMPONENT_METADATA_DATA {
10511 pub const ENCODED_LEN: usize = 108usize;
10512 pub const DEFAULT: Self = Self {
10513 time_boot_ms: 0_u32,
10514 file_crc: 0_u32,
10515 uri: CharArray::new([0_u8; 100usize]),
10516 };
10517 #[cfg(feature = "arbitrary")]
10518 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10519 use arbitrary::{Arbitrary, Unstructured};
10520 let mut buf = [0u8; 1024];
10521 rng.fill_bytes(&mut buf);
10522 let mut unstructured = Unstructured::new(&buf);
10523 Self::arbitrary(&mut unstructured).unwrap_or_default()
10524 }
10525}
10526impl Default for COMPONENT_METADATA_DATA {
10527 fn default() -> Self {
10528 Self::DEFAULT.clone()
10529 }
10530}
10531impl MessageData for COMPONENT_METADATA_DATA {
10532 type Message = MavMessage;
10533 const ID: u32 = 397u32;
10534 const NAME: &'static str = "COMPONENT_METADATA";
10535 const EXTRA_CRC: u8 = 182u8;
10536 const ENCODED_LEN: usize = 108usize;
10537 fn deser(
10538 _version: MavlinkVersion,
10539 __input: &[u8],
10540 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10541 let avail_len = __input.len();
10542 let mut payload_buf = [0; Self::ENCODED_LEN];
10543 let mut buf = if avail_len < Self::ENCODED_LEN {
10544 payload_buf[0..avail_len].copy_from_slice(__input);
10545 Bytes::new(&payload_buf)
10546 } else {
10547 Bytes::new(__input)
10548 };
10549 let mut __struct = Self::default();
10550 __struct.time_boot_ms = buf.get_u32_le();
10551 __struct.file_crc = buf.get_u32_le();
10552 let mut tmp = [0_u8; 100usize];
10553 for v in &mut tmp {
10554 *v = buf.get_u8();
10555 }
10556 __struct.uri = CharArray::new(tmp);
10557 Ok(__struct)
10558 }
10559 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10560 let mut __tmp = BytesMut::new(bytes);
10561 #[allow(clippy::absurd_extreme_comparisons)]
10562 #[allow(unused_comparisons)]
10563 if __tmp.remaining() < Self::ENCODED_LEN {
10564 panic!(
10565 "buffer is too small (need {} bytes, but got {})",
10566 Self::ENCODED_LEN,
10567 __tmp.remaining(),
10568 )
10569 }
10570 __tmp.put_u32_le(self.time_boot_ms);
10571 __tmp.put_u32_le(self.file_crc);
10572 for val in &self.uri {
10573 __tmp.put_u8(*val);
10574 }
10575 if matches!(version, MavlinkVersion::V2) {
10576 let len = __tmp.len();
10577 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10578 } else {
10579 __tmp.len()
10580 }
10581 }
10582}
10583#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
10584#[doc = ""]
10585#[doc = "ID: 146"]
10586#[derive(Debug, Clone, PartialEq)]
10587#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10588#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10589#[cfg_attr(feature = "ts", derive(TS))]
10590#[cfg_attr(feature = "ts", ts(export))]
10591pub struct CONTROL_SYSTEM_STATE_DATA {
10592 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10593 pub time_usec: u64,
10594 #[doc = "X acceleration in body frame"]
10595 pub x_acc: f32,
10596 #[doc = "Y acceleration in body frame"]
10597 pub y_acc: f32,
10598 #[doc = "Z acceleration in body frame"]
10599 pub z_acc: f32,
10600 #[doc = "X velocity in body frame"]
10601 pub x_vel: f32,
10602 #[doc = "Y velocity in body frame"]
10603 pub y_vel: f32,
10604 #[doc = "Z velocity in body frame"]
10605 pub z_vel: f32,
10606 #[doc = "X position in local frame"]
10607 pub x_pos: f32,
10608 #[doc = "Y position in local frame"]
10609 pub y_pos: f32,
10610 #[doc = "Z position in local frame"]
10611 pub z_pos: f32,
10612 #[doc = "Airspeed, set to -1 if unknown"]
10613 pub airspeed: f32,
10614 #[doc = "Variance of body velocity estimate"]
10615 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10616 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10617 pub vel_variance: [f32; 3],
10618 #[doc = "Variance in local position"]
10619 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10620 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10621 pub pos_variance: [f32; 3],
10622 #[doc = "The attitude, represented as Quaternion"]
10623 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10624 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10625 pub q: [f32; 4],
10626 #[doc = "Angular rate in roll axis"]
10627 pub roll_rate: f32,
10628 #[doc = "Angular rate in pitch axis"]
10629 pub pitch_rate: f32,
10630 #[doc = "Angular rate in yaw axis"]
10631 pub yaw_rate: f32,
10632}
10633impl CONTROL_SYSTEM_STATE_DATA {
10634 pub const ENCODED_LEN: usize = 100usize;
10635 pub const DEFAULT: Self = Self {
10636 time_usec: 0_u64,
10637 x_acc: 0.0_f32,
10638 y_acc: 0.0_f32,
10639 z_acc: 0.0_f32,
10640 x_vel: 0.0_f32,
10641 y_vel: 0.0_f32,
10642 z_vel: 0.0_f32,
10643 x_pos: 0.0_f32,
10644 y_pos: 0.0_f32,
10645 z_pos: 0.0_f32,
10646 airspeed: 0.0_f32,
10647 vel_variance: [0.0_f32; 3usize],
10648 pos_variance: [0.0_f32; 3usize],
10649 q: [0.0_f32; 4usize],
10650 roll_rate: 0.0_f32,
10651 pitch_rate: 0.0_f32,
10652 yaw_rate: 0.0_f32,
10653 };
10654 #[cfg(feature = "arbitrary")]
10655 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10656 use arbitrary::{Arbitrary, Unstructured};
10657 let mut buf = [0u8; 1024];
10658 rng.fill_bytes(&mut buf);
10659 let mut unstructured = Unstructured::new(&buf);
10660 Self::arbitrary(&mut unstructured).unwrap_or_default()
10661 }
10662}
10663impl Default for CONTROL_SYSTEM_STATE_DATA {
10664 fn default() -> Self {
10665 Self::DEFAULT.clone()
10666 }
10667}
10668impl MessageData for CONTROL_SYSTEM_STATE_DATA {
10669 type Message = MavMessage;
10670 const ID: u32 = 146u32;
10671 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
10672 const EXTRA_CRC: u8 = 103u8;
10673 const ENCODED_LEN: usize = 100usize;
10674 fn deser(
10675 _version: MavlinkVersion,
10676 __input: &[u8],
10677 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10678 let avail_len = __input.len();
10679 let mut payload_buf = [0; Self::ENCODED_LEN];
10680 let mut buf = if avail_len < Self::ENCODED_LEN {
10681 payload_buf[0..avail_len].copy_from_slice(__input);
10682 Bytes::new(&payload_buf)
10683 } else {
10684 Bytes::new(__input)
10685 };
10686 let mut __struct = Self::default();
10687 __struct.time_usec = buf.get_u64_le();
10688 __struct.x_acc = buf.get_f32_le();
10689 __struct.y_acc = buf.get_f32_le();
10690 __struct.z_acc = buf.get_f32_le();
10691 __struct.x_vel = buf.get_f32_le();
10692 __struct.y_vel = buf.get_f32_le();
10693 __struct.z_vel = buf.get_f32_le();
10694 __struct.x_pos = buf.get_f32_le();
10695 __struct.y_pos = buf.get_f32_le();
10696 __struct.z_pos = buf.get_f32_le();
10697 __struct.airspeed = buf.get_f32_le();
10698 for v in &mut __struct.vel_variance {
10699 let val = buf.get_f32_le();
10700 *v = val;
10701 }
10702 for v in &mut __struct.pos_variance {
10703 let val = buf.get_f32_le();
10704 *v = val;
10705 }
10706 for v in &mut __struct.q {
10707 let val = buf.get_f32_le();
10708 *v = val;
10709 }
10710 __struct.roll_rate = buf.get_f32_le();
10711 __struct.pitch_rate = buf.get_f32_le();
10712 __struct.yaw_rate = buf.get_f32_le();
10713 Ok(__struct)
10714 }
10715 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10716 let mut __tmp = BytesMut::new(bytes);
10717 #[allow(clippy::absurd_extreme_comparisons)]
10718 #[allow(unused_comparisons)]
10719 if __tmp.remaining() < Self::ENCODED_LEN {
10720 panic!(
10721 "buffer is too small (need {} bytes, but got {})",
10722 Self::ENCODED_LEN,
10723 __tmp.remaining(),
10724 )
10725 }
10726 __tmp.put_u64_le(self.time_usec);
10727 __tmp.put_f32_le(self.x_acc);
10728 __tmp.put_f32_le(self.y_acc);
10729 __tmp.put_f32_le(self.z_acc);
10730 __tmp.put_f32_le(self.x_vel);
10731 __tmp.put_f32_le(self.y_vel);
10732 __tmp.put_f32_le(self.z_vel);
10733 __tmp.put_f32_le(self.x_pos);
10734 __tmp.put_f32_le(self.y_pos);
10735 __tmp.put_f32_le(self.z_pos);
10736 __tmp.put_f32_le(self.airspeed);
10737 for val in &self.vel_variance {
10738 __tmp.put_f32_le(*val);
10739 }
10740 for val in &self.pos_variance {
10741 __tmp.put_f32_le(*val);
10742 }
10743 for val in &self.q {
10744 __tmp.put_f32_le(*val);
10745 }
10746 __tmp.put_f32_le(self.roll_rate);
10747 __tmp.put_f32_le(self.pitch_rate);
10748 __tmp.put_f32_le(self.yaw_rate);
10749 if matches!(version, MavlinkVersion::V2) {
10750 let len = __tmp.len();
10751 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10752 } else {
10753 __tmp.len()
10754 }
10755 }
10756}
10757#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
10758#[doc = ""]
10759#[doc = "ID: 411"]
10760#[derive(Debug, Clone, PartialEq)]
10761#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10762#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10763#[cfg_attr(feature = "ts", derive(TS))]
10764#[cfg_attr(feature = "ts", ts(export))]
10765pub struct CURRENT_EVENT_SEQUENCE_DATA {
10766 #[doc = "Sequence number."]
10767 pub sequence: u16,
10768 #[doc = "Flag bitset."]
10769 pub flags: MavEventCurrentSequenceFlags,
10770}
10771impl CURRENT_EVENT_SEQUENCE_DATA {
10772 pub const ENCODED_LEN: usize = 3usize;
10773 pub const DEFAULT: Self = Self {
10774 sequence: 0_u16,
10775 flags: MavEventCurrentSequenceFlags::DEFAULT,
10776 };
10777 #[cfg(feature = "arbitrary")]
10778 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10779 use arbitrary::{Arbitrary, Unstructured};
10780 let mut buf = [0u8; 1024];
10781 rng.fill_bytes(&mut buf);
10782 let mut unstructured = Unstructured::new(&buf);
10783 Self::arbitrary(&mut unstructured).unwrap_or_default()
10784 }
10785}
10786impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10787 fn default() -> Self {
10788 Self::DEFAULT.clone()
10789 }
10790}
10791impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10792 type Message = MavMessage;
10793 const ID: u32 = 411u32;
10794 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10795 const EXTRA_CRC: u8 = 106u8;
10796 const ENCODED_LEN: usize = 3usize;
10797 fn deser(
10798 _version: MavlinkVersion,
10799 __input: &[u8],
10800 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10801 let avail_len = __input.len();
10802 let mut payload_buf = [0; Self::ENCODED_LEN];
10803 let mut buf = if avail_len < Self::ENCODED_LEN {
10804 payload_buf[0..avail_len].copy_from_slice(__input);
10805 Bytes::new(&payload_buf)
10806 } else {
10807 Bytes::new(__input)
10808 };
10809 let mut __struct = Self::default();
10810 __struct.sequence = buf.get_u16_le();
10811 let tmp = buf.get_u8();
10812 __struct.flags =
10813 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10814 enum_type: "MavEventCurrentSequenceFlags",
10815 value: tmp as u32,
10816 })?;
10817 Ok(__struct)
10818 }
10819 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10820 let mut __tmp = BytesMut::new(bytes);
10821 #[allow(clippy::absurd_extreme_comparisons)]
10822 #[allow(unused_comparisons)]
10823 if __tmp.remaining() < Self::ENCODED_LEN {
10824 panic!(
10825 "buffer is too small (need {} bytes, but got {})",
10826 Self::ENCODED_LEN,
10827 __tmp.remaining(),
10828 )
10829 }
10830 __tmp.put_u16_le(self.sequence);
10831 __tmp.put_u8(self.flags as u8);
10832 if matches!(version, MavlinkVersion::V2) {
10833 let len = __tmp.len();
10834 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10835 } else {
10836 __tmp.len()
10837 }
10838 }
10839}
10840#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10841#[doc = ""]
10842#[doc = "ID: 436"]
10843#[derive(Debug, Clone, PartialEq)]
10844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10845#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10846#[cfg_attr(feature = "ts", derive(TS))]
10847#[cfg_attr(feature = "ts", ts(export))]
10848pub struct CURRENT_MODE_DATA {
10849 #[doc = "A bitfield for use for autopilot-specific flags"]
10850 pub custom_mode: u32,
10851 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10852 pub intended_custom_mode: u32,
10853 #[doc = "Standard mode."]
10854 pub standard_mode: MavStandardMode,
10855}
10856impl CURRENT_MODE_DATA {
10857 pub const ENCODED_LEN: usize = 9usize;
10858 pub const DEFAULT: Self = Self {
10859 custom_mode: 0_u32,
10860 intended_custom_mode: 0_u32,
10861 standard_mode: MavStandardMode::DEFAULT,
10862 };
10863 #[cfg(feature = "arbitrary")]
10864 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10865 use arbitrary::{Arbitrary, Unstructured};
10866 let mut buf = [0u8; 1024];
10867 rng.fill_bytes(&mut buf);
10868 let mut unstructured = Unstructured::new(&buf);
10869 Self::arbitrary(&mut unstructured).unwrap_or_default()
10870 }
10871}
10872impl Default for CURRENT_MODE_DATA {
10873 fn default() -> Self {
10874 Self::DEFAULT.clone()
10875 }
10876}
10877impl MessageData for CURRENT_MODE_DATA {
10878 type Message = MavMessage;
10879 const ID: u32 = 436u32;
10880 const NAME: &'static str = "CURRENT_MODE";
10881 const EXTRA_CRC: u8 = 193u8;
10882 const ENCODED_LEN: usize = 9usize;
10883 fn deser(
10884 _version: MavlinkVersion,
10885 __input: &[u8],
10886 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10887 let avail_len = __input.len();
10888 let mut payload_buf = [0; Self::ENCODED_LEN];
10889 let mut buf = if avail_len < Self::ENCODED_LEN {
10890 payload_buf[0..avail_len].copy_from_slice(__input);
10891 Bytes::new(&payload_buf)
10892 } else {
10893 Bytes::new(__input)
10894 };
10895 let mut __struct = Self::default();
10896 __struct.custom_mode = buf.get_u32_le();
10897 __struct.intended_custom_mode = buf.get_u32_le();
10898 let tmp = buf.get_u8();
10899 __struct.standard_mode =
10900 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10901 enum_type: "MavStandardMode",
10902 value: tmp as u32,
10903 })?;
10904 Ok(__struct)
10905 }
10906 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10907 let mut __tmp = BytesMut::new(bytes);
10908 #[allow(clippy::absurd_extreme_comparisons)]
10909 #[allow(unused_comparisons)]
10910 if __tmp.remaining() < Self::ENCODED_LEN {
10911 panic!(
10912 "buffer is too small (need {} bytes, but got {})",
10913 Self::ENCODED_LEN,
10914 __tmp.remaining(),
10915 )
10916 }
10917 __tmp.put_u32_le(self.custom_mode);
10918 __tmp.put_u32_le(self.intended_custom_mode);
10919 __tmp.put_u8(self.standard_mode as u8);
10920 if matches!(version, MavlinkVersion::V2) {
10921 let len = __tmp.len();
10922 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10923 } else {
10924 __tmp.len()
10925 }
10926 }
10927}
10928#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10929#[doc = "Data stream status information."]
10930#[doc = ""]
10931#[doc = "ID: 67"]
10932#[derive(Debug, Clone, PartialEq)]
10933#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10934#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10935#[cfg_attr(feature = "ts", derive(TS))]
10936#[cfg_attr(feature = "ts", ts(export))]
10937pub struct DATA_STREAM_DATA {
10938 #[doc = "The message rate"]
10939 pub message_rate: u16,
10940 #[doc = "The ID of the requested data stream"]
10941 pub stream_id: u8,
10942 #[doc = "1 stream is enabled, 0 stream is stopped."]
10943 pub on_off: u8,
10944}
10945impl DATA_STREAM_DATA {
10946 pub const ENCODED_LEN: usize = 4usize;
10947 pub const DEFAULT: Self = Self {
10948 message_rate: 0_u16,
10949 stream_id: 0_u8,
10950 on_off: 0_u8,
10951 };
10952 #[cfg(feature = "arbitrary")]
10953 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10954 use arbitrary::{Arbitrary, Unstructured};
10955 let mut buf = [0u8; 1024];
10956 rng.fill_bytes(&mut buf);
10957 let mut unstructured = Unstructured::new(&buf);
10958 Self::arbitrary(&mut unstructured).unwrap_or_default()
10959 }
10960}
10961impl Default for DATA_STREAM_DATA {
10962 fn default() -> Self {
10963 Self::DEFAULT.clone()
10964 }
10965}
10966impl MessageData for DATA_STREAM_DATA {
10967 type Message = MavMessage;
10968 const ID: u32 = 67u32;
10969 const NAME: &'static str = "DATA_STREAM";
10970 const EXTRA_CRC: u8 = 21u8;
10971 const ENCODED_LEN: usize = 4usize;
10972 fn deser(
10973 _version: MavlinkVersion,
10974 __input: &[u8],
10975 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10976 let avail_len = __input.len();
10977 let mut payload_buf = [0; Self::ENCODED_LEN];
10978 let mut buf = if avail_len < Self::ENCODED_LEN {
10979 payload_buf[0..avail_len].copy_from_slice(__input);
10980 Bytes::new(&payload_buf)
10981 } else {
10982 Bytes::new(__input)
10983 };
10984 let mut __struct = Self::default();
10985 __struct.message_rate = buf.get_u16_le();
10986 __struct.stream_id = buf.get_u8();
10987 __struct.on_off = buf.get_u8();
10988 Ok(__struct)
10989 }
10990 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10991 let mut __tmp = BytesMut::new(bytes);
10992 #[allow(clippy::absurd_extreme_comparisons)]
10993 #[allow(unused_comparisons)]
10994 if __tmp.remaining() < Self::ENCODED_LEN {
10995 panic!(
10996 "buffer is too small (need {} bytes, but got {})",
10997 Self::ENCODED_LEN,
10998 __tmp.remaining(),
10999 )
11000 }
11001 __tmp.put_u16_le(self.message_rate);
11002 __tmp.put_u8(self.stream_id);
11003 __tmp.put_u8(self.on_off);
11004 if matches!(version, MavlinkVersion::V2) {
11005 let len = __tmp.len();
11006 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11007 } else {
11008 __tmp.len()
11009 }
11010 }
11011}
11012#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11013#[doc = ""]
11014#[doc = "ID: 130"]
11015#[derive(Debug, Clone, PartialEq)]
11016#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11017#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11018#[cfg_attr(feature = "ts", derive(TS))]
11019#[cfg_attr(feature = "ts", ts(export))]
11020pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
11021 #[doc = "total data size (set on ACK only)."]
11022 pub size: u32,
11023 #[doc = "Width of a matrix or image."]
11024 pub width: u16,
11025 #[doc = "Height of a matrix or image."]
11026 pub height: u16,
11027 #[doc = "Number of packets being sent (set on ACK only)."]
11028 pub packets: u16,
11029 #[doc = "Type of requested/acknowledged data."]
11030 pub mavtype: MavlinkDataStreamType,
11031 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
11032 pub payload: u8,
11033 #[doc = "JPEG quality. Values: [1-100]."]
11034 pub jpg_quality: u8,
11035}
11036impl DATA_TRANSMISSION_HANDSHAKE_DATA {
11037 pub const ENCODED_LEN: usize = 13usize;
11038 pub const DEFAULT: Self = Self {
11039 size: 0_u32,
11040 width: 0_u16,
11041 height: 0_u16,
11042 packets: 0_u16,
11043 mavtype: MavlinkDataStreamType::DEFAULT,
11044 payload: 0_u8,
11045 jpg_quality: 0_u8,
11046 };
11047 #[cfg(feature = "arbitrary")]
11048 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11049 use arbitrary::{Arbitrary, Unstructured};
11050 let mut buf = [0u8; 1024];
11051 rng.fill_bytes(&mut buf);
11052 let mut unstructured = Unstructured::new(&buf);
11053 Self::arbitrary(&mut unstructured).unwrap_or_default()
11054 }
11055}
11056impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
11057 fn default() -> Self {
11058 Self::DEFAULT.clone()
11059 }
11060}
11061impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
11062 type Message = MavMessage;
11063 const ID: u32 = 130u32;
11064 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
11065 const EXTRA_CRC: u8 = 29u8;
11066 const ENCODED_LEN: usize = 13usize;
11067 fn deser(
11068 _version: MavlinkVersion,
11069 __input: &[u8],
11070 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11071 let avail_len = __input.len();
11072 let mut payload_buf = [0; Self::ENCODED_LEN];
11073 let mut buf = if avail_len < Self::ENCODED_LEN {
11074 payload_buf[0..avail_len].copy_from_slice(__input);
11075 Bytes::new(&payload_buf)
11076 } else {
11077 Bytes::new(__input)
11078 };
11079 let mut __struct = Self::default();
11080 __struct.size = buf.get_u32_le();
11081 __struct.width = buf.get_u16_le();
11082 __struct.height = buf.get_u16_le();
11083 __struct.packets = buf.get_u16_le();
11084 let tmp = buf.get_u8();
11085 __struct.mavtype =
11086 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11087 enum_type: "MavlinkDataStreamType",
11088 value: tmp as u32,
11089 })?;
11090 __struct.payload = buf.get_u8();
11091 __struct.jpg_quality = buf.get_u8();
11092 Ok(__struct)
11093 }
11094 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11095 let mut __tmp = BytesMut::new(bytes);
11096 #[allow(clippy::absurd_extreme_comparisons)]
11097 #[allow(unused_comparisons)]
11098 if __tmp.remaining() < Self::ENCODED_LEN {
11099 panic!(
11100 "buffer is too small (need {} bytes, but got {})",
11101 Self::ENCODED_LEN,
11102 __tmp.remaining(),
11103 )
11104 }
11105 __tmp.put_u32_le(self.size);
11106 __tmp.put_u16_le(self.width);
11107 __tmp.put_u16_le(self.height);
11108 __tmp.put_u16_le(self.packets);
11109 __tmp.put_u8(self.mavtype as u8);
11110 __tmp.put_u8(self.payload);
11111 __tmp.put_u8(self.jpg_quality);
11112 if matches!(version, MavlinkVersion::V2) {
11113 let len = __tmp.len();
11114 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11115 } else {
11116 __tmp.len()
11117 }
11118 }
11119}
11120#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
11121#[doc = ""]
11122#[doc = "ID: 254"]
11123#[derive(Debug, Clone, PartialEq)]
11124#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11125#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11126#[cfg_attr(feature = "ts", derive(TS))]
11127#[cfg_attr(feature = "ts", ts(export))]
11128pub struct DEBUG_DATA {
11129 #[doc = "Timestamp (time since system boot)."]
11130 pub time_boot_ms: u32,
11131 #[doc = "DEBUG value"]
11132 pub value: f32,
11133 #[doc = "index of debug variable"]
11134 pub ind: u8,
11135}
11136impl DEBUG_DATA {
11137 pub const ENCODED_LEN: usize = 9usize;
11138 pub const DEFAULT: Self = Self {
11139 time_boot_ms: 0_u32,
11140 value: 0.0_f32,
11141 ind: 0_u8,
11142 };
11143 #[cfg(feature = "arbitrary")]
11144 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11145 use arbitrary::{Arbitrary, Unstructured};
11146 let mut buf = [0u8; 1024];
11147 rng.fill_bytes(&mut buf);
11148 let mut unstructured = Unstructured::new(&buf);
11149 Self::arbitrary(&mut unstructured).unwrap_or_default()
11150 }
11151}
11152impl Default for DEBUG_DATA {
11153 fn default() -> Self {
11154 Self::DEFAULT.clone()
11155 }
11156}
11157impl MessageData for DEBUG_DATA {
11158 type Message = MavMessage;
11159 const ID: u32 = 254u32;
11160 const NAME: &'static str = "DEBUG";
11161 const EXTRA_CRC: u8 = 46u8;
11162 const ENCODED_LEN: usize = 9usize;
11163 fn deser(
11164 _version: MavlinkVersion,
11165 __input: &[u8],
11166 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11167 let avail_len = __input.len();
11168 let mut payload_buf = [0; Self::ENCODED_LEN];
11169 let mut buf = if avail_len < Self::ENCODED_LEN {
11170 payload_buf[0..avail_len].copy_from_slice(__input);
11171 Bytes::new(&payload_buf)
11172 } else {
11173 Bytes::new(__input)
11174 };
11175 let mut __struct = Self::default();
11176 __struct.time_boot_ms = buf.get_u32_le();
11177 __struct.value = buf.get_f32_le();
11178 __struct.ind = buf.get_u8();
11179 Ok(__struct)
11180 }
11181 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11182 let mut __tmp = BytesMut::new(bytes);
11183 #[allow(clippy::absurd_extreme_comparisons)]
11184 #[allow(unused_comparisons)]
11185 if __tmp.remaining() < Self::ENCODED_LEN {
11186 panic!(
11187 "buffer is too small (need {} bytes, but got {})",
11188 Self::ENCODED_LEN,
11189 __tmp.remaining(),
11190 )
11191 }
11192 __tmp.put_u32_le(self.time_boot_ms);
11193 __tmp.put_f32_le(self.value);
11194 __tmp.put_u8(self.ind);
11195 if matches!(version, MavlinkVersion::V2) {
11196 let len = __tmp.len();
11197 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11198 } else {
11199 __tmp.len()
11200 }
11201 }
11202}
11203#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
11204#[doc = ""]
11205#[doc = "ID: 350"]
11206#[derive(Debug, Clone, PartialEq)]
11207#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11208#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11209#[cfg_attr(feature = "ts", derive(TS))]
11210#[cfg_attr(feature = "ts", ts(export))]
11211pub struct DEBUG_FLOAT_ARRAY_DATA {
11212 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11213 pub time_usec: u64,
11214 #[doc = "Unique ID used to discriminate between arrays"]
11215 pub array_id: u16,
11216 #[doc = "Name, for human-friendly display in a Ground Control Station"]
11217 #[cfg_attr(feature = "ts", ts(type = "string"))]
11218 pub name: CharArray<10>,
11219 #[doc = "data"]
11220 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11221 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11222 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11223 pub data: [f32; 58],
11224}
11225impl DEBUG_FLOAT_ARRAY_DATA {
11226 pub const ENCODED_LEN: usize = 252usize;
11227 pub const DEFAULT: Self = Self {
11228 time_usec: 0_u64,
11229 array_id: 0_u16,
11230 name: CharArray::new([0_u8; 10usize]),
11231 data: [0.0_f32; 58usize],
11232 };
11233 #[cfg(feature = "arbitrary")]
11234 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11235 use arbitrary::{Arbitrary, Unstructured};
11236 let mut buf = [0u8; 1024];
11237 rng.fill_bytes(&mut buf);
11238 let mut unstructured = Unstructured::new(&buf);
11239 Self::arbitrary(&mut unstructured).unwrap_or_default()
11240 }
11241}
11242impl Default for DEBUG_FLOAT_ARRAY_DATA {
11243 fn default() -> Self {
11244 Self::DEFAULT.clone()
11245 }
11246}
11247impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
11248 type Message = MavMessage;
11249 const ID: u32 = 350u32;
11250 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
11251 const EXTRA_CRC: u8 = 232u8;
11252 const ENCODED_LEN: usize = 252usize;
11253 fn deser(
11254 _version: MavlinkVersion,
11255 __input: &[u8],
11256 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11257 let avail_len = __input.len();
11258 let mut payload_buf = [0; Self::ENCODED_LEN];
11259 let mut buf = if avail_len < Self::ENCODED_LEN {
11260 payload_buf[0..avail_len].copy_from_slice(__input);
11261 Bytes::new(&payload_buf)
11262 } else {
11263 Bytes::new(__input)
11264 };
11265 let mut __struct = Self::default();
11266 __struct.time_usec = buf.get_u64_le();
11267 __struct.array_id = buf.get_u16_le();
11268 let mut tmp = [0_u8; 10usize];
11269 for v in &mut tmp {
11270 *v = buf.get_u8();
11271 }
11272 __struct.name = CharArray::new(tmp);
11273 for v in &mut __struct.data {
11274 let val = buf.get_f32_le();
11275 *v = val;
11276 }
11277 Ok(__struct)
11278 }
11279 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11280 let mut __tmp = BytesMut::new(bytes);
11281 #[allow(clippy::absurd_extreme_comparisons)]
11282 #[allow(unused_comparisons)]
11283 if __tmp.remaining() < Self::ENCODED_LEN {
11284 panic!(
11285 "buffer is too small (need {} bytes, but got {})",
11286 Self::ENCODED_LEN,
11287 __tmp.remaining(),
11288 )
11289 }
11290 __tmp.put_u64_le(self.time_usec);
11291 __tmp.put_u16_le(self.array_id);
11292 for val in &self.name {
11293 __tmp.put_u8(*val);
11294 }
11295 if matches!(version, MavlinkVersion::V2) {
11296 for val in &self.data {
11297 __tmp.put_f32_le(*val);
11298 }
11299 let len = __tmp.len();
11300 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11301 } else {
11302 __tmp.len()
11303 }
11304 }
11305}
11306#[doc = "To debug something using a named 3D vector."]
11307#[doc = ""]
11308#[doc = "ID: 250"]
11309#[derive(Debug, Clone, PartialEq)]
11310#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11311#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11312#[cfg_attr(feature = "ts", derive(TS))]
11313#[cfg_attr(feature = "ts", ts(export))]
11314pub struct DEBUG_VECT_DATA {
11315 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11316 pub time_usec: u64,
11317 #[doc = "x"]
11318 pub x: f32,
11319 #[doc = "y"]
11320 pub y: f32,
11321 #[doc = "z"]
11322 pub z: f32,
11323 #[doc = "Name"]
11324 #[cfg_attr(feature = "ts", ts(type = "string"))]
11325 pub name: CharArray<10>,
11326}
11327impl DEBUG_VECT_DATA {
11328 pub const ENCODED_LEN: usize = 30usize;
11329 pub const DEFAULT: Self = Self {
11330 time_usec: 0_u64,
11331 x: 0.0_f32,
11332 y: 0.0_f32,
11333 z: 0.0_f32,
11334 name: CharArray::new([0_u8; 10usize]),
11335 };
11336 #[cfg(feature = "arbitrary")]
11337 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11338 use arbitrary::{Arbitrary, Unstructured};
11339 let mut buf = [0u8; 1024];
11340 rng.fill_bytes(&mut buf);
11341 let mut unstructured = Unstructured::new(&buf);
11342 Self::arbitrary(&mut unstructured).unwrap_or_default()
11343 }
11344}
11345impl Default for DEBUG_VECT_DATA {
11346 fn default() -> Self {
11347 Self::DEFAULT.clone()
11348 }
11349}
11350impl MessageData for DEBUG_VECT_DATA {
11351 type Message = MavMessage;
11352 const ID: u32 = 250u32;
11353 const NAME: &'static str = "DEBUG_VECT";
11354 const EXTRA_CRC: u8 = 49u8;
11355 const ENCODED_LEN: usize = 30usize;
11356 fn deser(
11357 _version: MavlinkVersion,
11358 __input: &[u8],
11359 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11360 let avail_len = __input.len();
11361 let mut payload_buf = [0; Self::ENCODED_LEN];
11362 let mut buf = if avail_len < Self::ENCODED_LEN {
11363 payload_buf[0..avail_len].copy_from_slice(__input);
11364 Bytes::new(&payload_buf)
11365 } else {
11366 Bytes::new(__input)
11367 };
11368 let mut __struct = Self::default();
11369 __struct.time_usec = buf.get_u64_le();
11370 __struct.x = buf.get_f32_le();
11371 __struct.y = buf.get_f32_le();
11372 __struct.z = buf.get_f32_le();
11373 let mut tmp = [0_u8; 10usize];
11374 for v in &mut tmp {
11375 *v = buf.get_u8();
11376 }
11377 __struct.name = CharArray::new(tmp);
11378 Ok(__struct)
11379 }
11380 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11381 let mut __tmp = BytesMut::new(bytes);
11382 #[allow(clippy::absurd_extreme_comparisons)]
11383 #[allow(unused_comparisons)]
11384 if __tmp.remaining() < Self::ENCODED_LEN {
11385 panic!(
11386 "buffer is too small (need {} bytes, but got {})",
11387 Self::ENCODED_LEN,
11388 __tmp.remaining(),
11389 )
11390 }
11391 __tmp.put_u64_le(self.time_usec);
11392 __tmp.put_f32_le(self.x);
11393 __tmp.put_f32_le(self.y);
11394 __tmp.put_f32_le(self.z);
11395 for val in &self.name {
11396 __tmp.put_u8(*val);
11397 }
11398 if matches!(version, MavlinkVersion::V2) {
11399 let len = __tmp.len();
11400 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11401 } else {
11402 __tmp.len()
11403 }
11404 }
11405}
11406#[doc = "Distance sensor information for an onboard rangefinder."]
11407#[doc = ""]
11408#[doc = "ID: 132"]
11409#[derive(Debug, Clone, PartialEq)]
11410#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11411#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11412#[cfg_attr(feature = "ts", derive(TS))]
11413#[cfg_attr(feature = "ts", ts(export))]
11414pub struct DISTANCE_SENSOR_DATA {
11415 #[doc = "Timestamp (time since system boot)."]
11416 pub time_boot_ms: u32,
11417 #[doc = "Minimum distance the sensor can measure"]
11418 pub min_distance: u16,
11419 #[doc = "Maximum distance the sensor can measure"]
11420 pub max_distance: u16,
11421 #[doc = "Current distance reading"]
11422 pub current_distance: u16,
11423 #[doc = "Type of distance sensor."]
11424 pub mavtype: MavDistanceSensor,
11425 #[doc = "Onboard ID of the sensor"]
11426 pub id: u8,
11427 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
11428 pub orientation: MavSensorOrientation,
11429 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
11430 pub covariance: u8,
11431 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
11432 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11433 pub horizontal_fov: f32,
11434 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
11435 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11436 pub vertical_fov: f32,
11437 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
11438 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11439 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11440 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11441 pub quaternion: [f32; 4],
11442 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
11443 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11444 pub signal_quality: u8,
11445}
11446impl DISTANCE_SENSOR_DATA {
11447 pub const ENCODED_LEN: usize = 39usize;
11448 pub const DEFAULT: Self = Self {
11449 time_boot_ms: 0_u32,
11450 min_distance: 0_u16,
11451 max_distance: 0_u16,
11452 current_distance: 0_u16,
11453 mavtype: MavDistanceSensor::DEFAULT,
11454 id: 0_u8,
11455 orientation: MavSensorOrientation::DEFAULT,
11456 covariance: 0_u8,
11457 horizontal_fov: 0.0_f32,
11458 vertical_fov: 0.0_f32,
11459 quaternion: [0.0_f32; 4usize],
11460 signal_quality: 0_u8,
11461 };
11462 #[cfg(feature = "arbitrary")]
11463 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11464 use arbitrary::{Arbitrary, Unstructured};
11465 let mut buf = [0u8; 1024];
11466 rng.fill_bytes(&mut buf);
11467 let mut unstructured = Unstructured::new(&buf);
11468 Self::arbitrary(&mut unstructured).unwrap_or_default()
11469 }
11470}
11471impl Default for DISTANCE_SENSOR_DATA {
11472 fn default() -> Self {
11473 Self::DEFAULT.clone()
11474 }
11475}
11476impl MessageData for DISTANCE_SENSOR_DATA {
11477 type Message = MavMessage;
11478 const ID: u32 = 132u32;
11479 const NAME: &'static str = "DISTANCE_SENSOR";
11480 const EXTRA_CRC: u8 = 85u8;
11481 const ENCODED_LEN: usize = 39usize;
11482 fn deser(
11483 _version: MavlinkVersion,
11484 __input: &[u8],
11485 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11486 let avail_len = __input.len();
11487 let mut payload_buf = [0; Self::ENCODED_LEN];
11488 let mut buf = if avail_len < Self::ENCODED_LEN {
11489 payload_buf[0..avail_len].copy_from_slice(__input);
11490 Bytes::new(&payload_buf)
11491 } else {
11492 Bytes::new(__input)
11493 };
11494 let mut __struct = Self::default();
11495 __struct.time_boot_ms = buf.get_u32_le();
11496 __struct.min_distance = buf.get_u16_le();
11497 __struct.max_distance = buf.get_u16_le();
11498 __struct.current_distance = buf.get_u16_le();
11499 let tmp = buf.get_u8();
11500 __struct.mavtype =
11501 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11502 enum_type: "MavDistanceSensor",
11503 value: tmp as u32,
11504 })?;
11505 __struct.id = buf.get_u8();
11506 let tmp = buf.get_u8();
11507 __struct.orientation =
11508 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11509 enum_type: "MavSensorOrientation",
11510 value: tmp as u32,
11511 })?;
11512 __struct.covariance = buf.get_u8();
11513 __struct.horizontal_fov = buf.get_f32_le();
11514 __struct.vertical_fov = buf.get_f32_le();
11515 for v in &mut __struct.quaternion {
11516 let val = buf.get_f32_le();
11517 *v = val;
11518 }
11519 __struct.signal_quality = buf.get_u8();
11520 Ok(__struct)
11521 }
11522 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11523 let mut __tmp = BytesMut::new(bytes);
11524 #[allow(clippy::absurd_extreme_comparisons)]
11525 #[allow(unused_comparisons)]
11526 if __tmp.remaining() < Self::ENCODED_LEN {
11527 panic!(
11528 "buffer is too small (need {} bytes, but got {})",
11529 Self::ENCODED_LEN,
11530 __tmp.remaining(),
11531 )
11532 }
11533 __tmp.put_u32_le(self.time_boot_ms);
11534 __tmp.put_u16_le(self.min_distance);
11535 __tmp.put_u16_le(self.max_distance);
11536 __tmp.put_u16_le(self.current_distance);
11537 __tmp.put_u8(self.mavtype as u8);
11538 __tmp.put_u8(self.id);
11539 __tmp.put_u8(self.orientation as u8);
11540 __tmp.put_u8(self.covariance);
11541 if matches!(version, MavlinkVersion::V2) {
11542 __tmp.put_f32_le(self.horizontal_fov);
11543 __tmp.put_f32_le(self.vertical_fov);
11544 for val in &self.quaternion {
11545 __tmp.put_f32_le(*val);
11546 }
11547 __tmp.put_u8(self.signal_quality);
11548 let len = __tmp.len();
11549 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11550 } else {
11551 __tmp.len()
11552 }
11553 }
11554}
11555#[doc = "EFI status output."]
11556#[doc = ""]
11557#[doc = "ID: 225"]
11558#[derive(Debug, Clone, PartialEq)]
11559#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11561#[cfg_attr(feature = "ts", derive(TS))]
11562#[cfg_attr(feature = "ts", ts(export))]
11563pub struct EFI_STATUS_DATA {
11564 #[doc = "ECU index"]
11565 pub ecu_index: f32,
11566 #[doc = "RPM"]
11567 pub rpm: f32,
11568 #[doc = "Fuel consumed"]
11569 pub fuel_consumed: f32,
11570 #[doc = "Fuel flow rate"]
11571 pub fuel_flow: f32,
11572 #[doc = "Engine load"]
11573 pub engine_load: f32,
11574 #[doc = "Throttle position"]
11575 pub throttle_position: f32,
11576 #[doc = "Spark dwell time"]
11577 pub spark_dwell_time: f32,
11578 #[doc = "Barometric pressure"]
11579 pub barometric_pressure: f32,
11580 #[doc = "Intake manifold pressure("]
11581 pub intake_manifold_pressure: f32,
11582 #[doc = "Intake manifold temperature"]
11583 pub intake_manifold_temperature: f32,
11584 #[doc = "Cylinder head temperature"]
11585 pub cylinder_head_temperature: f32,
11586 #[doc = "Ignition timing (Crank angle degrees)"]
11587 pub ignition_timing: f32,
11588 #[doc = "Injection time"]
11589 pub injection_time: f32,
11590 #[doc = "Exhaust gas temperature"]
11591 pub exhaust_gas_temperature: f32,
11592 #[doc = "Output throttle"]
11593 pub throttle_out: f32,
11594 #[doc = "Pressure/temperature compensation"]
11595 pub pt_compensation: f32,
11596 #[doc = "EFI health status"]
11597 pub health: u8,
11598 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
11599 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11600 pub ignition_voltage: f32,
11601 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
11602 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11603 pub fuel_pressure: f32,
11604}
11605impl EFI_STATUS_DATA {
11606 pub const ENCODED_LEN: usize = 73usize;
11607 pub const DEFAULT: Self = Self {
11608 ecu_index: 0.0_f32,
11609 rpm: 0.0_f32,
11610 fuel_consumed: 0.0_f32,
11611 fuel_flow: 0.0_f32,
11612 engine_load: 0.0_f32,
11613 throttle_position: 0.0_f32,
11614 spark_dwell_time: 0.0_f32,
11615 barometric_pressure: 0.0_f32,
11616 intake_manifold_pressure: 0.0_f32,
11617 intake_manifold_temperature: 0.0_f32,
11618 cylinder_head_temperature: 0.0_f32,
11619 ignition_timing: 0.0_f32,
11620 injection_time: 0.0_f32,
11621 exhaust_gas_temperature: 0.0_f32,
11622 throttle_out: 0.0_f32,
11623 pt_compensation: 0.0_f32,
11624 health: 0_u8,
11625 ignition_voltage: 0.0_f32,
11626 fuel_pressure: 0.0_f32,
11627 };
11628 #[cfg(feature = "arbitrary")]
11629 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11630 use arbitrary::{Arbitrary, Unstructured};
11631 let mut buf = [0u8; 1024];
11632 rng.fill_bytes(&mut buf);
11633 let mut unstructured = Unstructured::new(&buf);
11634 Self::arbitrary(&mut unstructured).unwrap_or_default()
11635 }
11636}
11637impl Default for EFI_STATUS_DATA {
11638 fn default() -> Self {
11639 Self::DEFAULT.clone()
11640 }
11641}
11642impl MessageData for EFI_STATUS_DATA {
11643 type Message = MavMessage;
11644 const ID: u32 = 225u32;
11645 const NAME: &'static str = "EFI_STATUS";
11646 const EXTRA_CRC: u8 = 208u8;
11647 const ENCODED_LEN: usize = 73usize;
11648 fn deser(
11649 _version: MavlinkVersion,
11650 __input: &[u8],
11651 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11652 let avail_len = __input.len();
11653 let mut payload_buf = [0; Self::ENCODED_LEN];
11654 let mut buf = if avail_len < Self::ENCODED_LEN {
11655 payload_buf[0..avail_len].copy_from_slice(__input);
11656 Bytes::new(&payload_buf)
11657 } else {
11658 Bytes::new(__input)
11659 };
11660 let mut __struct = Self::default();
11661 __struct.ecu_index = buf.get_f32_le();
11662 __struct.rpm = buf.get_f32_le();
11663 __struct.fuel_consumed = buf.get_f32_le();
11664 __struct.fuel_flow = buf.get_f32_le();
11665 __struct.engine_load = buf.get_f32_le();
11666 __struct.throttle_position = buf.get_f32_le();
11667 __struct.spark_dwell_time = buf.get_f32_le();
11668 __struct.barometric_pressure = buf.get_f32_le();
11669 __struct.intake_manifold_pressure = buf.get_f32_le();
11670 __struct.intake_manifold_temperature = buf.get_f32_le();
11671 __struct.cylinder_head_temperature = buf.get_f32_le();
11672 __struct.ignition_timing = buf.get_f32_le();
11673 __struct.injection_time = buf.get_f32_le();
11674 __struct.exhaust_gas_temperature = buf.get_f32_le();
11675 __struct.throttle_out = buf.get_f32_le();
11676 __struct.pt_compensation = buf.get_f32_le();
11677 __struct.health = buf.get_u8();
11678 __struct.ignition_voltage = buf.get_f32_le();
11679 __struct.fuel_pressure = buf.get_f32_le();
11680 Ok(__struct)
11681 }
11682 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11683 let mut __tmp = BytesMut::new(bytes);
11684 #[allow(clippy::absurd_extreme_comparisons)]
11685 #[allow(unused_comparisons)]
11686 if __tmp.remaining() < Self::ENCODED_LEN {
11687 panic!(
11688 "buffer is too small (need {} bytes, but got {})",
11689 Self::ENCODED_LEN,
11690 __tmp.remaining(),
11691 )
11692 }
11693 __tmp.put_f32_le(self.ecu_index);
11694 __tmp.put_f32_le(self.rpm);
11695 __tmp.put_f32_le(self.fuel_consumed);
11696 __tmp.put_f32_le(self.fuel_flow);
11697 __tmp.put_f32_le(self.engine_load);
11698 __tmp.put_f32_le(self.throttle_position);
11699 __tmp.put_f32_le(self.spark_dwell_time);
11700 __tmp.put_f32_le(self.barometric_pressure);
11701 __tmp.put_f32_le(self.intake_manifold_pressure);
11702 __tmp.put_f32_le(self.intake_manifold_temperature);
11703 __tmp.put_f32_le(self.cylinder_head_temperature);
11704 __tmp.put_f32_le(self.ignition_timing);
11705 __tmp.put_f32_le(self.injection_time);
11706 __tmp.put_f32_le(self.exhaust_gas_temperature);
11707 __tmp.put_f32_le(self.throttle_out);
11708 __tmp.put_f32_le(self.pt_compensation);
11709 __tmp.put_u8(self.health);
11710 if matches!(version, MavlinkVersion::V2) {
11711 __tmp.put_f32_le(self.ignition_voltage);
11712 __tmp.put_f32_le(self.fuel_pressure);
11713 let len = __tmp.len();
11714 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11715 } else {
11716 __tmp.len()
11717 }
11718 }
11719}
11720#[doc = "Extended EKF state estimates for ASLUAVs."]
11721#[doc = ""]
11722#[doc = "ID: 8007"]
11723#[derive(Debug, Clone, PartialEq)]
11724#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11725#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11726#[cfg_attr(feature = "ts", derive(TS))]
11727#[cfg_attr(feature = "ts", ts(export))]
11728pub struct EKF_EXT_DATA {
11729 #[doc = "Time since system start"]
11730 pub timestamp: u64,
11731 #[doc = "Magnitude of wind velocity (in lateral inertial plane)"]
11732 pub Windspeed: f32,
11733 #[doc = "Wind heading angle from North"]
11734 pub WindDir: f32,
11735 #[doc = "Z (Down) component of inertial wind velocity"]
11736 pub WindZ: f32,
11737 #[doc = "Magnitude of air velocity"]
11738 pub Airspeed: f32,
11739 #[doc = "Sideslip angle"]
11740 pub beta: f32,
11741 #[doc = "Angle of attack"]
11742 pub alpha: f32,
11743}
11744impl EKF_EXT_DATA {
11745 pub const ENCODED_LEN: usize = 32usize;
11746 pub const DEFAULT: Self = Self {
11747 timestamp: 0_u64,
11748 Windspeed: 0.0_f32,
11749 WindDir: 0.0_f32,
11750 WindZ: 0.0_f32,
11751 Airspeed: 0.0_f32,
11752 beta: 0.0_f32,
11753 alpha: 0.0_f32,
11754 };
11755 #[cfg(feature = "arbitrary")]
11756 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11757 use arbitrary::{Arbitrary, Unstructured};
11758 let mut buf = [0u8; 1024];
11759 rng.fill_bytes(&mut buf);
11760 let mut unstructured = Unstructured::new(&buf);
11761 Self::arbitrary(&mut unstructured).unwrap_or_default()
11762 }
11763}
11764impl Default for EKF_EXT_DATA {
11765 fn default() -> Self {
11766 Self::DEFAULT.clone()
11767 }
11768}
11769impl MessageData for EKF_EXT_DATA {
11770 type Message = MavMessage;
11771 const ID: u32 = 8007u32;
11772 const NAME: &'static str = "EKF_EXT";
11773 const EXTRA_CRC: u8 = 64u8;
11774 const ENCODED_LEN: usize = 32usize;
11775 fn deser(
11776 _version: MavlinkVersion,
11777 __input: &[u8],
11778 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11779 let avail_len = __input.len();
11780 let mut payload_buf = [0; Self::ENCODED_LEN];
11781 let mut buf = if avail_len < Self::ENCODED_LEN {
11782 payload_buf[0..avail_len].copy_from_slice(__input);
11783 Bytes::new(&payload_buf)
11784 } else {
11785 Bytes::new(__input)
11786 };
11787 let mut __struct = Self::default();
11788 __struct.timestamp = buf.get_u64_le();
11789 __struct.Windspeed = buf.get_f32_le();
11790 __struct.WindDir = buf.get_f32_le();
11791 __struct.WindZ = buf.get_f32_le();
11792 __struct.Airspeed = buf.get_f32_le();
11793 __struct.beta = buf.get_f32_le();
11794 __struct.alpha = buf.get_f32_le();
11795 Ok(__struct)
11796 }
11797 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11798 let mut __tmp = BytesMut::new(bytes);
11799 #[allow(clippy::absurd_extreme_comparisons)]
11800 #[allow(unused_comparisons)]
11801 if __tmp.remaining() < Self::ENCODED_LEN {
11802 panic!(
11803 "buffer is too small (need {} bytes, but got {})",
11804 Self::ENCODED_LEN,
11805 __tmp.remaining(),
11806 )
11807 }
11808 __tmp.put_u64_le(self.timestamp);
11809 __tmp.put_f32_le(self.Windspeed);
11810 __tmp.put_f32_le(self.WindDir);
11811 __tmp.put_f32_le(self.WindZ);
11812 __tmp.put_f32_le(self.Airspeed);
11813 __tmp.put_f32_le(self.beta);
11814 __tmp.put_f32_le(self.alpha);
11815 if matches!(version, MavlinkVersion::V2) {
11816 let len = __tmp.len();
11817 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11818 } else {
11819 __tmp.len()
11820 }
11821 }
11822}
11823#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11824#[doc = ""]
11825#[doc = "ID: 131"]
11826#[derive(Debug, Clone, PartialEq)]
11827#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11828#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11829#[cfg_attr(feature = "ts", derive(TS))]
11830#[cfg_attr(feature = "ts", ts(export))]
11831pub struct ENCAPSULATED_DATA_DATA {
11832 #[doc = "sequence number (starting with 0 on every transmission)"]
11833 pub seqnr: u16,
11834 #[doc = "image data bytes"]
11835 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11836 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11837 pub data: [u8; 253],
11838}
11839impl ENCAPSULATED_DATA_DATA {
11840 pub const ENCODED_LEN: usize = 255usize;
11841 pub const DEFAULT: Self = Self {
11842 seqnr: 0_u16,
11843 data: [0_u8; 253usize],
11844 };
11845 #[cfg(feature = "arbitrary")]
11846 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11847 use arbitrary::{Arbitrary, Unstructured};
11848 let mut buf = [0u8; 1024];
11849 rng.fill_bytes(&mut buf);
11850 let mut unstructured = Unstructured::new(&buf);
11851 Self::arbitrary(&mut unstructured).unwrap_or_default()
11852 }
11853}
11854impl Default for ENCAPSULATED_DATA_DATA {
11855 fn default() -> Self {
11856 Self::DEFAULT.clone()
11857 }
11858}
11859impl MessageData for ENCAPSULATED_DATA_DATA {
11860 type Message = MavMessage;
11861 const ID: u32 = 131u32;
11862 const NAME: &'static str = "ENCAPSULATED_DATA";
11863 const EXTRA_CRC: u8 = 223u8;
11864 const ENCODED_LEN: usize = 255usize;
11865 fn deser(
11866 _version: MavlinkVersion,
11867 __input: &[u8],
11868 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11869 let avail_len = __input.len();
11870 let mut payload_buf = [0; Self::ENCODED_LEN];
11871 let mut buf = if avail_len < Self::ENCODED_LEN {
11872 payload_buf[0..avail_len].copy_from_slice(__input);
11873 Bytes::new(&payload_buf)
11874 } else {
11875 Bytes::new(__input)
11876 };
11877 let mut __struct = Self::default();
11878 __struct.seqnr = buf.get_u16_le();
11879 for v in &mut __struct.data {
11880 let val = buf.get_u8();
11881 *v = val;
11882 }
11883 Ok(__struct)
11884 }
11885 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11886 let mut __tmp = BytesMut::new(bytes);
11887 #[allow(clippy::absurd_extreme_comparisons)]
11888 #[allow(unused_comparisons)]
11889 if __tmp.remaining() < Self::ENCODED_LEN {
11890 panic!(
11891 "buffer is too small (need {} bytes, but got {})",
11892 Self::ENCODED_LEN,
11893 __tmp.remaining(),
11894 )
11895 }
11896 __tmp.put_u16_le(self.seqnr);
11897 for val in &self.data {
11898 __tmp.put_u8(*val);
11899 }
11900 if matches!(version, MavlinkVersion::V2) {
11901 let len = __tmp.len();
11902 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11903 } else {
11904 __tmp.len()
11905 }
11906 }
11907}
11908#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11909#[doc = ""]
11910#[doc = "ID: 290"]
11911#[derive(Debug, Clone, PartialEq)]
11912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11913#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11914#[cfg_attr(feature = "ts", derive(TS))]
11915#[cfg_attr(feature = "ts", ts(export))]
11916pub struct ESC_INFO_DATA {
11917 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11918 pub time_usec: u64,
11919 #[doc = "Number of reported errors by each ESC since boot."]
11920 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11921 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11922 pub error_count: [u32; 4],
11923 #[doc = "Counter of data packets received."]
11924 pub counter: u16,
11925 #[doc = "Bitmap of ESC failure flags."]
11926 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11927 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11928 pub failure_flags: [u16; 4],
11929 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11930 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11931 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11932 pub temperature: [i16; 4],
11933 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11934 pub index: u8,
11935 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11936 pub count: u8,
11937 #[doc = "Connection type protocol for all ESC."]
11938 pub connection_type: EscConnectionType,
11939 #[doc = "Information regarding online/offline status of each ESC."]
11940 pub info: u8,
11941}
11942impl ESC_INFO_DATA {
11943 pub const ENCODED_LEN: usize = 46usize;
11944 pub const DEFAULT: Self = Self {
11945 time_usec: 0_u64,
11946 error_count: [0_u32; 4usize],
11947 counter: 0_u16,
11948 failure_flags: [0_u16; 4usize],
11949 temperature: [0_i16; 4usize],
11950 index: 0_u8,
11951 count: 0_u8,
11952 connection_type: EscConnectionType::DEFAULT,
11953 info: 0_u8,
11954 };
11955 #[cfg(feature = "arbitrary")]
11956 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11957 use arbitrary::{Arbitrary, Unstructured};
11958 let mut buf = [0u8; 1024];
11959 rng.fill_bytes(&mut buf);
11960 let mut unstructured = Unstructured::new(&buf);
11961 Self::arbitrary(&mut unstructured).unwrap_or_default()
11962 }
11963}
11964impl Default for ESC_INFO_DATA {
11965 fn default() -> Self {
11966 Self::DEFAULT.clone()
11967 }
11968}
11969impl MessageData for ESC_INFO_DATA {
11970 type Message = MavMessage;
11971 const ID: u32 = 290u32;
11972 const NAME: &'static str = "ESC_INFO";
11973 const EXTRA_CRC: u8 = 251u8;
11974 const ENCODED_LEN: usize = 46usize;
11975 fn deser(
11976 _version: MavlinkVersion,
11977 __input: &[u8],
11978 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11979 let avail_len = __input.len();
11980 let mut payload_buf = [0; Self::ENCODED_LEN];
11981 let mut buf = if avail_len < Self::ENCODED_LEN {
11982 payload_buf[0..avail_len].copy_from_slice(__input);
11983 Bytes::new(&payload_buf)
11984 } else {
11985 Bytes::new(__input)
11986 };
11987 let mut __struct = Self::default();
11988 __struct.time_usec = buf.get_u64_le();
11989 for v in &mut __struct.error_count {
11990 let val = buf.get_u32_le();
11991 *v = val;
11992 }
11993 __struct.counter = buf.get_u16_le();
11994 for v in &mut __struct.failure_flags {
11995 let val = buf.get_u16_le();
11996 *v = val;
11997 }
11998 for v in &mut __struct.temperature {
11999 let val = buf.get_i16_le();
12000 *v = val;
12001 }
12002 __struct.index = buf.get_u8();
12003 __struct.count = buf.get_u8();
12004 let tmp = buf.get_u8();
12005 __struct.connection_type =
12006 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12007 enum_type: "EscConnectionType",
12008 value: tmp as u32,
12009 })?;
12010 __struct.info = buf.get_u8();
12011 Ok(__struct)
12012 }
12013 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12014 let mut __tmp = BytesMut::new(bytes);
12015 #[allow(clippy::absurd_extreme_comparisons)]
12016 #[allow(unused_comparisons)]
12017 if __tmp.remaining() < Self::ENCODED_LEN {
12018 panic!(
12019 "buffer is too small (need {} bytes, but got {})",
12020 Self::ENCODED_LEN,
12021 __tmp.remaining(),
12022 )
12023 }
12024 __tmp.put_u64_le(self.time_usec);
12025 for val in &self.error_count {
12026 __tmp.put_u32_le(*val);
12027 }
12028 __tmp.put_u16_le(self.counter);
12029 for val in &self.failure_flags {
12030 __tmp.put_u16_le(*val);
12031 }
12032 for val in &self.temperature {
12033 __tmp.put_i16_le(*val);
12034 }
12035 __tmp.put_u8(self.index);
12036 __tmp.put_u8(self.count);
12037 __tmp.put_u8(self.connection_type as u8);
12038 __tmp.put_u8(self.info);
12039 if matches!(version, MavlinkVersion::V2) {
12040 let len = __tmp.len();
12041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12042 } else {
12043 __tmp.len()
12044 }
12045 }
12046}
12047#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
12048#[doc = ""]
12049#[doc = "ID: 291"]
12050#[derive(Debug, Clone, PartialEq)]
12051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12052#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12053#[cfg_attr(feature = "ts", derive(TS))]
12054#[cfg_attr(feature = "ts", ts(export))]
12055pub struct ESC_STATUS_DATA {
12056 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
12057 pub time_usec: u64,
12058 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
12059 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12060 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12061 pub rpm: [i32; 4],
12062 #[doc = "Voltage measured from each ESC."]
12063 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12064 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12065 pub voltage: [f32; 4],
12066 #[doc = "Current measured from each ESC."]
12067 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12068 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12069 pub current: [f32; 4],
12070 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
12071 pub index: u8,
12072}
12073impl ESC_STATUS_DATA {
12074 pub const ENCODED_LEN: usize = 57usize;
12075 pub const DEFAULT: Self = Self {
12076 time_usec: 0_u64,
12077 rpm: [0_i32; 4usize],
12078 voltage: [0.0_f32; 4usize],
12079 current: [0.0_f32; 4usize],
12080 index: 0_u8,
12081 };
12082 #[cfg(feature = "arbitrary")]
12083 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12084 use arbitrary::{Arbitrary, Unstructured};
12085 let mut buf = [0u8; 1024];
12086 rng.fill_bytes(&mut buf);
12087 let mut unstructured = Unstructured::new(&buf);
12088 Self::arbitrary(&mut unstructured).unwrap_or_default()
12089 }
12090}
12091impl Default for ESC_STATUS_DATA {
12092 fn default() -> Self {
12093 Self::DEFAULT.clone()
12094 }
12095}
12096impl MessageData for ESC_STATUS_DATA {
12097 type Message = MavMessage;
12098 const ID: u32 = 291u32;
12099 const NAME: &'static str = "ESC_STATUS";
12100 const EXTRA_CRC: u8 = 10u8;
12101 const ENCODED_LEN: usize = 57usize;
12102 fn deser(
12103 _version: MavlinkVersion,
12104 __input: &[u8],
12105 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12106 let avail_len = __input.len();
12107 let mut payload_buf = [0; Self::ENCODED_LEN];
12108 let mut buf = if avail_len < Self::ENCODED_LEN {
12109 payload_buf[0..avail_len].copy_from_slice(__input);
12110 Bytes::new(&payload_buf)
12111 } else {
12112 Bytes::new(__input)
12113 };
12114 let mut __struct = Self::default();
12115 __struct.time_usec = buf.get_u64_le();
12116 for v in &mut __struct.rpm {
12117 let val = buf.get_i32_le();
12118 *v = val;
12119 }
12120 for v in &mut __struct.voltage {
12121 let val = buf.get_f32_le();
12122 *v = val;
12123 }
12124 for v in &mut __struct.current {
12125 let val = buf.get_f32_le();
12126 *v = val;
12127 }
12128 __struct.index = buf.get_u8();
12129 Ok(__struct)
12130 }
12131 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12132 let mut __tmp = BytesMut::new(bytes);
12133 #[allow(clippy::absurd_extreme_comparisons)]
12134 #[allow(unused_comparisons)]
12135 if __tmp.remaining() < Self::ENCODED_LEN {
12136 panic!(
12137 "buffer is too small (need {} bytes, but got {})",
12138 Self::ENCODED_LEN,
12139 __tmp.remaining(),
12140 )
12141 }
12142 __tmp.put_u64_le(self.time_usec);
12143 for val in &self.rpm {
12144 __tmp.put_i32_le(*val);
12145 }
12146 for val in &self.voltage {
12147 __tmp.put_f32_le(*val);
12148 }
12149 for val in &self.current {
12150 __tmp.put_f32_le(*val);
12151 }
12152 __tmp.put_u8(self.index);
12153 if matches!(version, MavlinkVersion::V2) {
12154 let len = __tmp.len();
12155 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12156 } else {
12157 __tmp.len()
12158 }
12159 }
12160}
12161#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
12162#[doc = ""]
12163#[doc = "ID: 230"]
12164#[derive(Debug, Clone, PartialEq)]
12165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12166#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12167#[cfg_attr(feature = "ts", derive(TS))]
12168#[cfg_attr(feature = "ts", ts(export))]
12169pub struct ESTIMATOR_STATUS_DATA {
12170 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
12171 pub time_usec: u64,
12172 #[doc = "Velocity innovation test ratio"]
12173 pub vel_ratio: f32,
12174 #[doc = "Horizontal position innovation test ratio"]
12175 pub pos_horiz_ratio: f32,
12176 #[doc = "Vertical position innovation test ratio"]
12177 pub pos_vert_ratio: f32,
12178 #[doc = "Magnetometer innovation test ratio"]
12179 pub mag_ratio: f32,
12180 #[doc = "Height above terrain innovation test ratio"]
12181 pub hagl_ratio: f32,
12182 #[doc = "True airspeed innovation test ratio"]
12183 pub tas_ratio: f32,
12184 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
12185 pub pos_horiz_accuracy: f32,
12186 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
12187 pub pos_vert_accuracy: f32,
12188 #[doc = "Bitmap indicating which EKF outputs are valid."]
12189 pub flags: EstimatorStatusFlags,
12190}
12191impl ESTIMATOR_STATUS_DATA {
12192 pub const ENCODED_LEN: usize = 42usize;
12193 pub const DEFAULT: Self = Self {
12194 time_usec: 0_u64,
12195 vel_ratio: 0.0_f32,
12196 pos_horiz_ratio: 0.0_f32,
12197 pos_vert_ratio: 0.0_f32,
12198 mag_ratio: 0.0_f32,
12199 hagl_ratio: 0.0_f32,
12200 tas_ratio: 0.0_f32,
12201 pos_horiz_accuracy: 0.0_f32,
12202 pos_vert_accuracy: 0.0_f32,
12203 flags: EstimatorStatusFlags::DEFAULT,
12204 };
12205 #[cfg(feature = "arbitrary")]
12206 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12207 use arbitrary::{Arbitrary, Unstructured};
12208 let mut buf = [0u8; 1024];
12209 rng.fill_bytes(&mut buf);
12210 let mut unstructured = Unstructured::new(&buf);
12211 Self::arbitrary(&mut unstructured).unwrap_or_default()
12212 }
12213}
12214impl Default for ESTIMATOR_STATUS_DATA {
12215 fn default() -> Self {
12216 Self::DEFAULT.clone()
12217 }
12218}
12219impl MessageData for ESTIMATOR_STATUS_DATA {
12220 type Message = MavMessage;
12221 const ID: u32 = 230u32;
12222 const NAME: &'static str = "ESTIMATOR_STATUS";
12223 const EXTRA_CRC: u8 = 163u8;
12224 const ENCODED_LEN: usize = 42usize;
12225 fn deser(
12226 _version: MavlinkVersion,
12227 __input: &[u8],
12228 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12229 let avail_len = __input.len();
12230 let mut payload_buf = [0; Self::ENCODED_LEN];
12231 let mut buf = if avail_len < Self::ENCODED_LEN {
12232 payload_buf[0..avail_len].copy_from_slice(__input);
12233 Bytes::new(&payload_buf)
12234 } else {
12235 Bytes::new(__input)
12236 };
12237 let mut __struct = Self::default();
12238 __struct.time_usec = buf.get_u64_le();
12239 __struct.vel_ratio = buf.get_f32_le();
12240 __struct.pos_horiz_ratio = buf.get_f32_le();
12241 __struct.pos_vert_ratio = buf.get_f32_le();
12242 __struct.mag_ratio = buf.get_f32_le();
12243 __struct.hagl_ratio = buf.get_f32_le();
12244 __struct.tas_ratio = buf.get_f32_le();
12245 __struct.pos_horiz_accuracy = buf.get_f32_le();
12246 __struct.pos_vert_accuracy = buf.get_f32_le();
12247 let tmp = buf.get_u16_le();
12248 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
12249 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12250 flag_type: "EstimatorStatusFlags",
12251 value: tmp as u32,
12252 })?;
12253 Ok(__struct)
12254 }
12255 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12256 let mut __tmp = BytesMut::new(bytes);
12257 #[allow(clippy::absurd_extreme_comparisons)]
12258 #[allow(unused_comparisons)]
12259 if __tmp.remaining() < Self::ENCODED_LEN {
12260 panic!(
12261 "buffer is too small (need {} bytes, but got {})",
12262 Self::ENCODED_LEN,
12263 __tmp.remaining(),
12264 )
12265 }
12266 __tmp.put_u64_le(self.time_usec);
12267 __tmp.put_f32_le(self.vel_ratio);
12268 __tmp.put_f32_le(self.pos_horiz_ratio);
12269 __tmp.put_f32_le(self.pos_vert_ratio);
12270 __tmp.put_f32_le(self.mag_ratio);
12271 __tmp.put_f32_le(self.hagl_ratio);
12272 __tmp.put_f32_le(self.tas_ratio);
12273 __tmp.put_f32_le(self.pos_horiz_accuracy);
12274 __tmp.put_f32_le(self.pos_vert_accuracy);
12275 __tmp.put_u16_le(self.flags.bits());
12276 if matches!(version, MavlinkVersion::V2) {
12277 let len = __tmp.len();
12278 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12279 } else {
12280 __tmp.len()
12281 }
12282 }
12283}
12284#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
12285#[doc = ""]
12286#[doc = "ID: 410"]
12287#[derive(Debug, Clone, PartialEq)]
12288#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12290#[cfg_attr(feature = "ts", derive(TS))]
12291#[cfg_attr(feature = "ts", ts(export))]
12292pub struct EVENT_DATA {
12293 #[doc = "Event ID (as defined in the component metadata)"]
12294 pub id: u32,
12295 #[doc = "Timestamp (time since system boot when the event happened)."]
12296 pub event_time_boot_ms: u32,
12297 #[doc = "Sequence number."]
12298 pub sequence: u16,
12299 #[doc = "Component ID"]
12300 pub destination_component: u8,
12301 #[doc = "System ID"]
12302 pub destination_system: u8,
12303 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
12304 pub log_levels: u8,
12305 #[doc = "Arguments (depend on event ID)."]
12306 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12307 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12308 pub arguments: [u8; 40],
12309}
12310impl EVENT_DATA {
12311 pub const ENCODED_LEN: usize = 53usize;
12312 pub const DEFAULT: Self = Self {
12313 id: 0_u32,
12314 event_time_boot_ms: 0_u32,
12315 sequence: 0_u16,
12316 destination_component: 0_u8,
12317 destination_system: 0_u8,
12318 log_levels: 0_u8,
12319 arguments: [0_u8; 40usize],
12320 };
12321 #[cfg(feature = "arbitrary")]
12322 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12323 use arbitrary::{Arbitrary, Unstructured};
12324 let mut buf = [0u8; 1024];
12325 rng.fill_bytes(&mut buf);
12326 let mut unstructured = Unstructured::new(&buf);
12327 Self::arbitrary(&mut unstructured).unwrap_or_default()
12328 }
12329}
12330impl Default for EVENT_DATA {
12331 fn default() -> Self {
12332 Self::DEFAULT.clone()
12333 }
12334}
12335impl MessageData for EVENT_DATA {
12336 type Message = MavMessage;
12337 const ID: u32 = 410u32;
12338 const NAME: &'static str = "EVENT";
12339 const EXTRA_CRC: u8 = 160u8;
12340 const ENCODED_LEN: usize = 53usize;
12341 fn deser(
12342 _version: MavlinkVersion,
12343 __input: &[u8],
12344 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12345 let avail_len = __input.len();
12346 let mut payload_buf = [0; Self::ENCODED_LEN];
12347 let mut buf = if avail_len < Self::ENCODED_LEN {
12348 payload_buf[0..avail_len].copy_from_slice(__input);
12349 Bytes::new(&payload_buf)
12350 } else {
12351 Bytes::new(__input)
12352 };
12353 let mut __struct = Self::default();
12354 __struct.id = buf.get_u32_le();
12355 __struct.event_time_boot_ms = buf.get_u32_le();
12356 __struct.sequence = buf.get_u16_le();
12357 __struct.destination_component = buf.get_u8();
12358 __struct.destination_system = buf.get_u8();
12359 __struct.log_levels = buf.get_u8();
12360 for v in &mut __struct.arguments {
12361 let val = buf.get_u8();
12362 *v = val;
12363 }
12364 Ok(__struct)
12365 }
12366 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12367 let mut __tmp = BytesMut::new(bytes);
12368 #[allow(clippy::absurd_extreme_comparisons)]
12369 #[allow(unused_comparisons)]
12370 if __tmp.remaining() < Self::ENCODED_LEN {
12371 panic!(
12372 "buffer is too small (need {} bytes, but got {})",
12373 Self::ENCODED_LEN,
12374 __tmp.remaining(),
12375 )
12376 }
12377 __tmp.put_u32_le(self.id);
12378 __tmp.put_u32_le(self.event_time_boot_ms);
12379 __tmp.put_u16_le(self.sequence);
12380 __tmp.put_u8(self.destination_component);
12381 __tmp.put_u8(self.destination_system);
12382 __tmp.put_u8(self.log_levels);
12383 for val in &self.arguments {
12384 __tmp.put_u8(*val);
12385 }
12386 if matches!(version, MavlinkVersion::V2) {
12387 let len = __tmp.len();
12388 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12389 } else {
12390 __tmp.len()
12391 }
12392 }
12393}
12394#[doc = "Provides state for additional features."]
12395#[doc = ""]
12396#[doc = "ID: 245"]
12397#[derive(Debug, Clone, PartialEq)]
12398#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12399#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12400#[cfg_attr(feature = "ts", derive(TS))]
12401#[cfg_attr(feature = "ts", ts(export))]
12402pub struct EXTENDED_SYS_STATE_DATA {
12403 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
12404 pub vtol_state: MavVtolState,
12405 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
12406 pub landed_state: MavLandedState,
12407}
12408impl EXTENDED_SYS_STATE_DATA {
12409 pub const ENCODED_LEN: usize = 2usize;
12410 pub const DEFAULT: Self = Self {
12411 vtol_state: MavVtolState::DEFAULT,
12412 landed_state: MavLandedState::DEFAULT,
12413 };
12414 #[cfg(feature = "arbitrary")]
12415 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12416 use arbitrary::{Arbitrary, Unstructured};
12417 let mut buf = [0u8; 1024];
12418 rng.fill_bytes(&mut buf);
12419 let mut unstructured = Unstructured::new(&buf);
12420 Self::arbitrary(&mut unstructured).unwrap_or_default()
12421 }
12422}
12423impl Default for EXTENDED_SYS_STATE_DATA {
12424 fn default() -> Self {
12425 Self::DEFAULT.clone()
12426 }
12427}
12428impl MessageData for EXTENDED_SYS_STATE_DATA {
12429 type Message = MavMessage;
12430 const ID: u32 = 245u32;
12431 const NAME: &'static str = "EXTENDED_SYS_STATE";
12432 const EXTRA_CRC: u8 = 130u8;
12433 const ENCODED_LEN: usize = 2usize;
12434 fn deser(
12435 _version: MavlinkVersion,
12436 __input: &[u8],
12437 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12438 let avail_len = __input.len();
12439 let mut payload_buf = [0; Self::ENCODED_LEN];
12440 let mut buf = if avail_len < Self::ENCODED_LEN {
12441 payload_buf[0..avail_len].copy_from_slice(__input);
12442 Bytes::new(&payload_buf)
12443 } else {
12444 Bytes::new(__input)
12445 };
12446 let mut __struct = Self::default();
12447 let tmp = buf.get_u8();
12448 __struct.vtol_state =
12449 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12450 enum_type: "MavVtolState",
12451 value: tmp as u32,
12452 })?;
12453 let tmp = buf.get_u8();
12454 __struct.landed_state =
12455 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12456 enum_type: "MavLandedState",
12457 value: tmp as u32,
12458 })?;
12459 Ok(__struct)
12460 }
12461 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12462 let mut __tmp = BytesMut::new(bytes);
12463 #[allow(clippy::absurd_extreme_comparisons)]
12464 #[allow(unused_comparisons)]
12465 if __tmp.remaining() < Self::ENCODED_LEN {
12466 panic!(
12467 "buffer is too small (need {} bytes, but got {})",
12468 Self::ENCODED_LEN,
12469 __tmp.remaining(),
12470 )
12471 }
12472 __tmp.put_u8(self.vtol_state as u8);
12473 __tmp.put_u8(self.landed_state as u8);
12474 if matches!(version, MavlinkVersion::V2) {
12475 let len = __tmp.len();
12476 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12477 } else {
12478 __tmp.len()
12479 }
12480 }
12481}
12482#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
12483#[doc = ""]
12484#[doc = "ID: 162"]
12485#[derive(Debug, Clone, PartialEq)]
12486#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12487#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12488#[cfg_attr(feature = "ts", derive(TS))]
12489#[cfg_attr(feature = "ts", ts(export))]
12490pub struct FENCE_STATUS_DATA {
12491 #[doc = "Time (since boot) of last breach."]
12492 pub breach_time: u32,
12493 #[doc = "Number of fence breaches."]
12494 pub breach_count: u16,
12495 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
12496 pub breach_status: u8,
12497 #[doc = "Last breach type."]
12498 pub breach_type: FenceBreach,
12499 #[doc = "Active action to prevent fence breach"]
12500 #[cfg_attr(feature = "serde", serde(default))]
12501 pub breach_mitigation: FenceMitigate,
12502}
12503impl FENCE_STATUS_DATA {
12504 pub const ENCODED_LEN: usize = 9usize;
12505 pub const DEFAULT: Self = Self {
12506 breach_time: 0_u32,
12507 breach_count: 0_u16,
12508 breach_status: 0_u8,
12509 breach_type: FenceBreach::DEFAULT,
12510 breach_mitigation: FenceMitigate::DEFAULT,
12511 };
12512 #[cfg(feature = "arbitrary")]
12513 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12514 use arbitrary::{Arbitrary, Unstructured};
12515 let mut buf = [0u8; 1024];
12516 rng.fill_bytes(&mut buf);
12517 let mut unstructured = Unstructured::new(&buf);
12518 Self::arbitrary(&mut unstructured).unwrap_or_default()
12519 }
12520}
12521impl Default for FENCE_STATUS_DATA {
12522 fn default() -> Self {
12523 Self::DEFAULT.clone()
12524 }
12525}
12526impl MessageData for FENCE_STATUS_DATA {
12527 type Message = MavMessage;
12528 const ID: u32 = 162u32;
12529 const NAME: &'static str = "FENCE_STATUS";
12530 const EXTRA_CRC: u8 = 189u8;
12531 const ENCODED_LEN: usize = 9usize;
12532 fn deser(
12533 _version: MavlinkVersion,
12534 __input: &[u8],
12535 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12536 let avail_len = __input.len();
12537 let mut payload_buf = [0; Self::ENCODED_LEN];
12538 let mut buf = if avail_len < Self::ENCODED_LEN {
12539 payload_buf[0..avail_len].copy_from_slice(__input);
12540 Bytes::new(&payload_buf)
12541 } else {
12542 Bytes::new(__input)
12543 };
12544 let mut __struct = Self::default();
12545 __struct.breach_time = buf.get_u32_le();
12546 __struct.breach_count = buf.get_u16_le();
12547 __struct.breach_status = buf.get_u8();
12548 let tmp = buf.get_u8();
12549 __struct.breach_type =
12550 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12551 enum_type: "FenceBreach",
12552 value: tmp as u32,
12553 })?;
12554 let tmp = buf.get_u8();
12555 __struct.breach_mitigation =
12556 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12557 enum_type: "FenceMitigate",
12558 value: tmp as u32,
12559 })?;
12560 Ok(__struct)
12561 }
12562 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12563 let mut __tmp = BytesMut::new(bytes);
12564 #[allow(clippy::absurd_extreme_comparisons)]
12565 #[allow(unused_comparisons)]
12566 if __tmp.remaining() < Self::ENCODED_LEN {
12567 panic!(
12568 "buffer is too small (need {} bytes, but got {})",
12569 Self::ENCODED_LEN,
12570 __tmp.remaining(),
12571 )
12572 }
12573 __tmp.put_u32_le(self.breach_time);
12574 __tmp.put_u16_le(self.breach_count);
12575 __tmp.put_u8(self.breach_status);
12576 __tmp.put_u8(self.breach_type as u8);
12577 if matches!(version, MavlinkVersion::V2) {
12578 __tmp.put_u8(self.breach_mitigation as u8);
12579 let len = __tmp.len();
12580 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12581 } else {
12582 __tmp.len()
12583 }
12584 }
12585}
12586#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
12587#[doc = ""]
12588#[doc = "ID: 110"]
12589#[derive(Debug, Clone, PartialEq)]
12590#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12591#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12592#[cfg_attr(feature = "ts", derive(TS))]
12593#[cfg_attr(feature = "ts", ts(export))]
12594pub struct FILE_TRANSFER_PROTOCOL_DATA {
12595 #[doc = "Network ID (0 for broadcast)"]
12596 pub target_network: u8,
12597 #[doc = "System ID (0 for broadcast)"]
12598 pub target_system: u8,
12599 #[doc = "Component ID (0 for broadcast)"]
12600 pub target_component: u8,
12601 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
12602 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12603 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12604 pub payload: [u8; 251],
12605}
12606impl FILE_TRANSFER_PROTOCOL_DATA {
12607 pub const ENCODED_LEN: usize = 254usize;
12608 pub const DEFAULT: Self = Self {
12609 target_network: 0_u8,
12610 target_system: 0_u8,
12611 target_component: 0_u8,
12612 payload: [0_u8; 251usize],
12613 };
12614 #[cfg(feature = "arbitrary")]
12615 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12616 use arbitrary::{Arbitrary, Unstructured};
12617 let mut buf = [0u8; 1024];
12618 rng.fill_bytes(&mut buf);
12619 let mut unstructured = Unstructured::new(&buf);
12620 Self::arbitrary(&mut unstructured).unwrap_or_default()
12621 }
12622}
12623impl Default for FILE_TRANSFER_PROTOCOL_DATA {
12624 fn default() -> Self {
12625 Self::DEFAULT.clone()
12626 }
12627}
12628impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
12629 type Message = MavMessage;
12630 const ID: u32 = 110u32;
12631 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
12632 const EXTRA_CRC: u8 = 84u8;
12633 const ENCODED_LEN: usize = 254usize;
12634 fn deser(
12635 _version: MavlinkVersion,
12636 __input: &[u8],
12637 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12638 let avail_len = __input.len();
12639 let mut payload_buf = [0; Self::ENCODED_LEN];
12640 let mut buf = if avail_len < Self::ENCODED_LEN {
12641 payload_buf[0..avail_len].copy_from_slice(__input);
12642 Bytes::new(&payload_buf)
12643 } else {
12644 Bytes::new(__input)
12645 };
12646 let mut __struct = Self::default();
12647 __struct.target_network = buf.get_u8();
12648 __struct.target_system = buf.get_u8();
12649 __struct.target_component = buf.get_u8();
12650 for v in &mut __struct.payload {
12651 let val = buf.get_u8();
12652 *v = val;
12653 }
12654 Ok(__struct)
12655 }
12656 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12657 let mut __tmp = BytesMut::new(bytes);
12658 #[allow(clippy::absurd_extreme_comparisons)]
12659 #[allow(unused_comparisons)]
12660 if __tmp.remaining() < Self::ENCODED_LEN {
12661 panic!(
12662 "buffer is too small (need {} bytes, but got {})",
12663 Self::ENCODED_LEN,
12664 __tmp.remaining(),
12665 )
12666 }
12667 __tmp.put_u8(self.target_network);
12668 __tmp.put_u8(self.target_system);
12669 __tmp.put_u8(self.target_component);
12670 for val in &self.payload {
12671 __tmp.put_u8(*val);
12672 }
12673 if matches!(version, MavlinkVersion::V2) {
12674 let len = __tmp.len();
12675 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12676 } else {
12677 __tmp.len()
12678 }
12679 }
12680}
12681#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
12682#[doc = ""]
12683#[doc = "ID: 264"]
12684#[derive(Debug, Clone, PartialEq)]
12685#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12686#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12687#[cfg_attr(feature = "ts", derive(TS))]
12688#[cfg_attr(feature = "ts", ts(export))]
12689pub struct FLIGHT_INFORMATION_DATA {
12690 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
12691 pub arming_time_utc: u64,
12692 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
12693 pub takeoff_time_utc: u64,
12694 #[doc = "Flight number. Note, field is misnamed UUID."]
12695 pub flight_uuid: u64,
12696 #[doc = "Timestamp (time since system boot)."]
12697 pub time_boot_ms: u32,
12698 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
12699 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12700 pub landing_time: u32,
12701}
12702impl FLIGHT_INFORMATION_DATA {
12703 pub const ENCODED_LEN: usize = 32usize;
12704 pub const DEFAULT: Self = Self {
12705 arming_time_utc: 0_u64,
12706 takeoff_time_utc: 0_u64,
12707 flight_uuid: 0_u64,
12708 time_boot_ms: 0_u32,
12709 landing_time: 0_u32,
12710 };
12711 #[cfg(feature = "arbitrary")]
12712 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12713 use arbitrary::{Arbitrary, Unstructured};
12714 let mut buf = [0u8; 1024];
12715 rng.fill_bytes(&mut buf);
12716 let mut unstructured = Unstructured::new(&buf);
12717 Self::arbitrary(&mut unstructured).unwrap_or_default()
12718 }
12719}
12720impl Default for FLIGHT_INFORMATION_DATA {
12721 fn default() -> Self {
12722 Self::DEFAULT.clone()
12723 }
12724}
12725impl MessageData for FLIGHT_INFORMATION_DATA {
12726 type Message = MavMessage;
12727 const ID: u32 = 264u32;
12728 const NAME: &'static str = "FLIGHT_INFORMATION";
12729 const EXTRA_CRC: u8 = 49u8;
12730 const ENCODED_LEN: usize = 32usize;
12731 fn deser(
12732 _version: MavlinkVersion,
12733 __input: &[u8],
12734 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12735 let avail_len = __input.len();
12736 let mut payload_buf = [0; Self::ENCODED_LEN];
12737 let mut buf = if avail_len < Self::ENCODED_LEN {
12738 payload_buf[0..avail_len].copy_from_slice(__input);
12739 Bytes::new(&payload_buf)
12740 } else {
12741 Bytes::new(__input)
12742 };
12743 let mut __struct = Self::default();
12744 __struct.arming_time_utc = buf.get_u64_le();
12745 __struct.takeoff_time_utc = buf.get_u64_le();
12746 __struct.flight_uuid = buf.get_u64_le();
12747 __struct.time_boot_ms = buf.get_u32_le();
12748 __struct.landing_time = buf.get_u32_le();
12749 Ok(__struct)
12750 }
12751 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12752 let mut __tmp = BytesMut::new(bytes);
12753 #[allow(clippy::absurd_extreme_comparisons)]
12754 #[allow(unused_comparisons)]
12755 if __tmp.remaining() < Self::ENCODED_LEN {
12756 panic!(
12757 "buffer is too small (need {} bytes, but got {})",
12758 Self::ENCODED_LEN,
12759 __tmp.remaining(),
12760 )
12761 }
12762 __tmp.put_u64_le(self.arming_time_utc);
12763 __tmp.put_u64_le(self.takeoff_time_utc);
12764 __tmp.put_u64_le(self.flight_uuid);
12765 __tmp.put_u32_le(self.time_boot_ms);
12766 if matches!(version, MavlinkVersion::V2) {
12767 __tmp.put_u32_le(self.landing_time);
12768 let len = __tmp.len();
12769 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12770 } else {
12771 __tmp.len()
12772 }
12773 }
12774}
12775#[doc = "Current motion information from a designated system."]
12776#[doc = ""]
12777#[doc = "ID: 144"]
12778#[derive(Debug, Clone, PartialEq)]
12779#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12780#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12781#[cfg_attr(feature = "ts", derive(TS))]
12782#[cfg_attr(feature = "ts", ts(export))]
12783pub struct FOLLOW_TARGET_DATA {
12784 #[doc = "Timestamp (time since system boot)."]
12785 pub timestamp: u64,
12786 #[doc = "button states or switches of a tracker device"]
12787 pub custom_state: u64,
12788 #[doc = "Latitude (WGS84)"]
12789 pub lat: i32,
12790 #[doc = "Longitude (WGS84)"]
12791 pub lon: i32,
12792 #[doc = "Altitude (MSL)"]
12793 pub alt: f32,
12794 #[doc = "target velocity (0,0,0) for unknown"]
12795 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12796 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12797 pub vel: [f32; 3],
12798 #[doc = "linear target acceleration (0,0,0) for unknown"]
12799 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12800 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12801 pub acc: [f32; 3],
12802 #[doc = "(0 0 0 0 for unknown)"]
12803 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12804 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12805 pub attitude_q: [f32; 4],
12806 #[doc = "(0 0 0 for unknown)"]
12807 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12808 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12809 pub rates: [f32; 3],
12810 #[doc = "eph epv"]
12811 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12812 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12813 pub position_cov: [f32; 3],
12814 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
12815 pub est_capabilities: u8,
12816}
12817impl FOLLOW_TARGET_DATA {
12818 pub const ENCODED_LEN: usize = 93usize;
12819 pub const DEFAULT: Self = Self {
12820 timestamp: 0_u64,
12821 custom_state: 0_u64,
12822 lat: 0_i32,
12823 lon: 0_i32,
12824 alt: 0.0_f32,
12825 vel: [0.0_f32; 3usize],
12826 acc: [0.0_f32; 3usize],
12827 attitude_q: [0.0_f32; 4usize],
12828 rates: [0.0_f32; 3usize],
12829 position_cov: [0.0_f32; 3usize],
12830 est_capabilities: 0_u8,
12831 };
12832 #[cfg(feature = "arbitrary")]
12833 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12834 use arbitrary::{Arbitrary, Unstructured};
12835 let mut buf = [0u8; 1024];
12836 rng.fill_bytes(&mut buf);
12837 let mut unstructured = Unstructured::new(&buf);
12838 Self::arbitrary(&mut unstructured).unwrap_or_default()
12839 }
12840}
12841impl Default for FOLLOW_TARGET_DATA {
12842 fn default() -> Self {
12843 Self::DEFAULT.clone()
12844 }
12845}
12846impl MessageData for FOLLOW_TARGET_DATA {
12847 type Message = MavMessage;
12848 const ID: u32 = 144u32;
12849 const NAME: &'static str = "FOLLOW_TARGET";
12850 const EXTRA_CRC: u8 = 127u8;
12851 const ENCODED_LEN: usize = 93usize;
12852 fn deser(
12853 _version: MavlinkVersion,
12854 __input: &[u8],
12855 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12856 let avail_len = __input.len();
12857 let mut payload_buf = [0; Self::ENCODED_LEN];
12858 let mut buf = if avail_len < Self::ENCODED_LEN {
12859 payload_buf[0..avail_len].copy_from_slice(__input);
12860 Bytes::new(&payload_buf)
12861 } else {
12862 Bytes::new(__input)
12863 };
12864 let mut __struct = Self::default();
12865 __struct.timestamp = buf.get_u64_le();
12866 __struct.custom_state = buf.get_u64_le();
12867 __struct.lat = buf.get_i32_le();
12868 __struct.lon = buf.get_i32_le();
12869 __struct.alt = buf.get_f32_le();
12870 for v in &mut __struct.vel {
12871 let val = buf.get_f32_le();
12872 *v = val;
12873 }
12874 for v in &mut __struct.acc {
12875 let val = buf.get_f32_le();
12876 *v = val;
12877 }
12878 for v in &mut __struct.attitude_q {
12879 let val = buf.get_f32_le();
12880 *v = val;
12881 }
12882 for v in &mut __struct.rates {
12883 let val = buf.get_f32_le();
12884 *v = val;
12885 }
12886 for v in &mut __struct.position_cov {
12887 let val = buf.get_f32_le();
12888 *v = val;
12889 }
12890 __struct.est_capabilities = buf.get_u8();
12891 Ok(__struct)
12892 }
12893 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12894 let mut __tmp = BytesMut::new(bytes);
12895 #[allow(clippy::absurd_extreme_comparisons)]
12896 #[allow(unused_comparisons)]
12897 if __tmp.remaining() < Self::ENCODED_LEN {
12898 panic!(
12899 "buffer is too small (need {} bytes, but got {})",
12900 Self::ENCODED_LEN,
12901 __tmp.remaining(),
12902 )
12903 }
12904 __tmp.put_u64_le(self.timestamp);
12905 __tmp.put_u64_le(self.custom_state);
12906 __tmp.put_i32_le(self.lat);
12907 __tmp.put_i32_le(self.lon);
12908 __tmp.put_f32_le(self.alt);
12909 for val in &self.vel {
12910 __tmp.put_f32_le(*val);
12911 }
12912 for val in &self.acc {
12913 __tmp.put_f32_le(*val);
12914 }
12915 for val in &self.attitude_q {
12916 __tmp.put_f32_le(*val);
12917 }
12918 for val in &self.rates {
12919 __tmp.put_f32_le(*val);
12920 }
12921 for val in &self.position_cov {
12922 __tmp.put_f32_le(*val);
12923 }
12924 __tmp.put_u8(self.est_capabilities);
12925 if matches!(version, MavlinkVersion::V2) {
12926 let len = __tmp.len();
12927 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12928 } else {
12929 __tmp.len()
12930 }
12931 }
12932}
12933#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12934#[doc = ""]
12935#[doc = "ID: 371"]
12936#[derive(Debug, Clone, PartialEq)]
12937#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12938#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12939#[cfg_attr(feature = "ts", derive(TS))]
12940#[cfg_attr(feature = "ts", ts(export))]
12941pub struct FUEL_STATUS_DATA {
12942 #[doc = "Capacity when full. Must be provided."]
12943 pub maximum_fuel: f32,
12944 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12945 pub consumed_fuel: f32,
12946 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12947 pub remaining_fuel: f32,
12948 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12949 pub flow_rate: f32,
12950 #[doc = "Fuel temperature. NaN: field not provided."]
12951 pub temperature: f32,
12952 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12953 pub fuel_type: MavFuelType,
12954 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12955 pub id: u8,
12956 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12957 pub percent_remaining: u8,
12958}
12959impl FUEL_STATUS_DATA {
12960 pub const ENCODED_LEN: usize = 26usize;
12961 pub const DEFAULT: Self = Self {
12962 maximum_fuel: 0.0_f32,
12963 consumed_fuel: 0.0_f32,
12964 remaining_fuel: 0.0_f32,
12965 flow_rate: 0.0_f32,
12966 temperature: 0.0_f32,
12967 fuel_type: MavFuelType::DEFAULT,
12968 id: 0_u8,
12969 percent_remaining: 0_u8,
12970 };
12971 #[cfg(feature = "arbitrary")]
12972 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12973 use arbitrary::{Arbitrary, Unstructured};
12974 let mut buf = [0u8; 1024];
12975 rng.fill_bytes(&mut buf);
12976 let mut unstructured = Unstructured::new(&buf);
12977 Self::arbitrary(&mut unstructured).unwrap_or_default()
12978 }
12979}
12980impl Default for FUEL_STATUS_DATA {
12981 fn default() -> Self {
12982 Self::DEFAULT.clone()
12983 }
12984}
12985impl MessageData for FUEL_STATUS_DATA {
12986 type Message = MavMessage;
12987 const ID: u32 = 371u32;
12988 const NAME: &'static str = "FUEL_STATUS";
12989 const EXTRA_CRC: u8 = 10u8;
12990 const ENCODED_LEN: usize = 26usize;
12991 fn deser(
12992 _version: MavlinkVersion,
12993 __input: &[u8],
12994 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12995 let avail_len = __input.len();
12996 let mut payload_buf = [0; Self::ENCODED_LEN];
12997 let mut buf = if avail_len < Self::ENCODED_LEN {
12998 payload_buf[0..avail_len].copy_from_slice(__input);
12999 Bytes::new(&payload_buf)
13000 } else {
13001 Bytes::new(__input)
13002 };
13003 let mut __struct = Self::default();
13004 __struct.maximum_fuel = buf.get_f32_le();
13005 __struct.consumed_fuel = buf.get_f32_le();
13006 __struct.remaining_fuel = buf.get_f32_le();
13007 __struct.flow_rate = buf.get_f32_le();
13008 __struct.temperature = buf.get_f32_le();
13009 let tmp = buf.get_u32_le();
13010 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
13011 ::mavlink_core::error::ParserError::InvalidEnum {
13012 enum_type: "MavFuelType",
13013 value: tmp as u32,
13014 },
13015 )?;
13016 __struct.id = buf.get_u8();
13017 __struct.percent_remaining = buf.get_u8();
13018 Ok(__struct)
13019 }
13020 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13021 let mut __tmp = BytesMut::new(bytes);
13022 #[allow(clippy::absurd_extreme_comparisons)]
13023 #[allow(unused_comparisons)]
13024 if __tmp.remaining() < Self::ENCODED_LEN {
13025 panic!(
13026 "buffer is too small (need {} bytes, but got {})",
13027 Self::ENCODED_LEN,
13028 __tmp.remaining(),
13029 )
13030 }
13031 __tmp.put_f32_le(self.maximum_fuel);
13032 __tmp.put_f32_le(self.consumed_fuel);
13033 __tmp.put_f32_le(self.remaining_fuel);
13034 __tmp.put_f32_le(self.flow_rate);
13035 __tmp.put_f32_le(self.temperature);
13036 __tmp.put_u32_le(self.fuel_type as u32);
13037 __tmp.put_u8(self.id);
13038 __tmp.put_u8(self.percent_remaining);
13039 if matches!(version, MavlinkVersion::V2) {
13040 let len = __tmp.len();
13041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13042 } else {
13043 __tmp.len()
13044 }
13045 }
13046}
13047#[doc = "Fixed-wing soaring (i.e. thermal seeking) data."]
13048#[doc = ""]
13049#[doc = "ID: 8011"]
13050#[derive(Debug, Clone, PartialEq)]
13051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13052#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13053#[cfg_attr(feature = "ts", derive(TS))]
13054#[cfg_attr(feature = "ts", ts(export))]
13055pub struct FW_SOARING_DATA_DATA {
13056 #[doc = "Timestamp"]
13057 pub timestamp: u64,
13058 #[doc = "Timestamp since last mode change"]
13059 pub timestampModeChanged: u64,
13060 #[doc = "Thermal core updraft strength"]
13061 pub xW: f32,
13062 #[doc = "Thermal radius"]
13063 pub xR: f32,
13064 #[doc = "Thermal center latitude"]
13065 pub xLat: f32,
13066 #[doc = "Thermal center longitude"]
13067 pub xLon: f32,
13068 #[doc = "Variance W"]
13069 pub VarW: f32,
13070 #[doc = "Variance R"]
13071 pub VarR: f32,
13072 #[doc = "Variance Lat"]
13073 pub VarLat: f32,
13074 #[doc = "Variance Lon"]
13075 pub VarLon: f32,
13076 #[doc = "Suggested loiter radius"]
13077 pub LoiterRadius: f32,
13078 #[doc = "Suggested loiter direction"]
13079 pub LoiterDirection: f32,
13080 #[doc = "Distance to soar point"]
13081 pub DistToSoarPoint: f32,
13082 #[doc = "Expected sink rate at current airspeed, roll and throttle"]
13083 pub vSinkExp: f32,
13084 #[doc = "Measurement / updraft speed at current/local airplane position"]
13085 pub z1_LocalUpdraftSpeed: f32,
13086 #[doc = "Measurement / roll angle tracking error"]
13087 pub z2_DeltaRoll: f32,
13088 #[doc = "Expected measurement 1"]
13089 pub z1_exp: f32,
13090 #[doc = "Expected measurement 2"]
13091 pub z2_exp: f32,
13092 #[doc = "Thermal drift (from estimator prediction step only)"]
13093 pub ThermalGSNorth: f32,
13094 #[doc = "Thermal drift (from estimator prediction step only)"]
13095 pub ThermalGSEast: f32,
13096 #[doc = "Total specific energy change (filtered)"]
13097 pub TSE_dot: f32,
13098 #[doc = "Debug variable 1"]
13099 pub DebugVar1: f32,
13100 #[doc = "Debug variable 2"]
13101 pub DebugVar2: f32,
13102 #[doc = "Control Mode [-]"]
13103 pub ControlMode: u8,
13104 #[doc = "Data valid [-]"]
13105 pub valid: u8,
13106}
13107impl FW_SOARING_DATA_DATA {
13108 pub const ENCODED_LEN: usize = 102usize;
13109 pub const DEFAULT: Self = Self {
13110 timestamp: 0_u64,
13111 timestampModeChanged: 0_u64,
13112 xW: 0.0_f32,
13113 xR: 0.0_f32,
13114 xLat: 0.0_f32,
13115 xLon: 0.0_f32,
13116 VarW: 0.0_f32,
13117 VarR: 0.0_f32,
13118 VarLat: 0.0_f32,
13119 VarLon: 0.0_f32,
13120 LoiterRadius: 0.0_f32,
13121 LoiterDirection: 0.0_f32,
13122 DistToSoarPoint: 0.0_f32,
13123 vSinkExp: 0.0_f32,
13124 z1_LocalUpdraftSpeed: 0.0_f32,
13125 z2_DeltaRoll: 0.0_f32,
13126 z1_exp: 0.0_f32,
13127 z2_exp: 0.0_f32,
13128 ThermalGSNorth: 0.0_f32,
13129 ThermalGSEast: 0.0_f32,
13130 TSE_dot: 0.0_f32,
13131 DebugVar1: 0.0_f32,
13132 DebugVar2: 0.0_f32,
13133 ControlMode: 0_u8,
13134 valid: 0_u8,
13135 };
13136 #[cfg(feature = "arbitrary")]
13137 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13138 use arbitrary::{Arbitrary, Unstructured};
13139 let mut buf = [0u8; 1024];
13140 rng.fill_bytes(&mut buf);
13141 let mut unstructured = Unstructured::new(&buf);
13142 Self::arbitrary(&mut unstructured).unwrap_or_default()
13143 }
13144}
13145impl Default for FW_SOARING_DATA_DATA {
13146 fn default() -> Self {
13147 Self::DEFAULT.clone()
13148 }
13149}
13150impl MessageData for FW_SOARING_DATA_DATA {
13151 type Message = MavMessage;
13152 const ID: u32 = 8011u32;
13153 const NAME: &'static str = "FW_SOARING_DATA";
13154 const EXTRA_CRC: u8 = 20u8;
13155 const ENCODED_LEN: usize = 102usize;
13156 fn deser(
13157 _version: MavlinkVersion,
13158 __input: &[u8],
13159 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13160 let avail_len = __input.len();
13161 let mut payload_buf = [0; Self::ENCODED_LEN];
13162 let mut buf = if avail_len < Self::ENCODED_LEN {
13163 payload_buf[0..avail_len].copy_from_slice(__input);
13164 Bytes::new(&payload_buf)
13165 } else {
13166 Bytes::new(__input)
13167 };
13168 let mut __struct = Self::default();
13169 __struct.timestamp = buf.get_u64_le();
13170 __struct.timestampModeChanged = buf.get_u64_le();
13171 __struct.xW = buf.get_f32_le();
13172 __struct.xR = buf.get_f32_le();
13173 __struct.xLat = buf.get_f32_le();
13174 __struct.xLon = buf.get_f32_le();
13175 __struct.VarW = buf.get_f32_le();
13176 __struct.VarR = buf.get_f32_le();
13177 __struct.VarLat = buf.get_f32_le();
13178 __struct.VarLon = buf.get_f32_le();
13179 __struct.LoiterRadius = buf.get_f32_le();
13180 __struct.LoiterDirection = buf.get_f32_le();
13181 __struct.DistToSoarPoint = buf.get_f32_le();
13182 __struct.vSinkExp = buf.get_f32_le();
13183 __struct.z1_LocalUpdraftSpeed = buf.get_f32_le();
13184 __struct.z2_DeltaRoll = buf.get_f32_le();
13185 __struct.z1_exp = buf.get_f32_le();
13186 __struct.z2_exp = buf.get_f32_le();
13187 __struct.ThermalGSNorth = buf.get_f32_le();
13188 __struct.ThermalGSEast = buf.get_f32_le();
13189 __struct.TSE_dot = buf.get_f32_le();
13190 __struct.DebugVar1 = buf.get_f32_le();
13191 __struct.DebugVar2 = buf.get_f32_le();
13192 __struct.ControlMode = buf.get_u8();
13193 __struct.valid = buf.get_u8();
13194 Ok(__struct)
13195 }
13196 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13197 let mut __tmp = BytesMut::new(bytes);
13198 #[allow(clippy::absurd_extreme_comparisons)]
13199 #[allow(unused_comparisons)]
13200 if __tmp.remaining() < Self::ENCODED_LEN {
13201 panic!(
13202 "buffer is too small (need {} bytes, but got {})",
13203 Self::ENCODED_LEN,
13204 __tmp.remaining(),
13205 )
13206 }
13207 __tmp.put_u64_le(self.timestamp);
13208 __tmp.put_u64_le(self.timestampModeChanged);
13209 __tmp.put_f32_le(self.xW);
13210 __tmp.put_f32_le(self.xR);
13211 __tmp.put_f32_le(self.xLat);
13212 __tmp.put_f32_le(self.xLon);
13213 __tmp.put_f32_le(self.VarW);
13214 __tmp.put_f32_le(self.VarR);
13215 __tmp.put_f32_le(self.VarLat);
13216 __tmp.put_f32_le(self.VarLon);
13217 __tmp.put_f32_le(self.LoiterRadius);
13218 __tmp.put_f32_le(self.LoiterDirection);
13219 __tmp.put_f32_le(self.DistToSoarPoint);
13220 __tmp.put_f32_le(self.vSinkExp);
13221 __tmp.put_f32_le(self.z1_LocalUpdraftSpeed);
13222 __tmp.put_f32_le(self.z2_DeltaRoll);
13223 __tmp.put_f32_le(self.z1_exp);
13224 __tmp.put_f32_le(self.z2_exp);
13225 __tmp.put_f32_le(self.ThermalGSNorth);
13226 __tmp.put_f32_le(self.ThermalGSEast);
13227 __tmp.put_f32_le(self.TSE_dot);
13228 __tmp.put_f32_le(self.DebugVar1);
13229 __tmp.put_f32_le(self.DebugVar2);
13230 __tmp.put_u8(self.ControlMode);
13231 __tmp.put_u8(self.valid);
13232 if matches!(version, MavlinkVersion::V2) {
13233 let len = __tmp.len();
13234 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13235 } else {
13236 __tmp.len()
13237 }
13238 }
13239}
13240#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
13241#[doc = ""]
13242#[doc = "ID: 373"]
13243#[derive(Debug, Clone, PartialEq)]
13244#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13245#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13246#[cfg_attr(feature = "ts", derive(TS))]
13247#[cfg_attr(feature = "ts", ts(export))]
13248pub struct GENERATOR_STATUS_DATA {
13249 #[doc = "Status flags."]
13250 pub status: MavGeneratorStatusFlag,
13251 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
13252 pub battery_current: f32,
13253 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
13254 pub load_current: f32,
13255 #[doc = "The power being generated. NaN: field not provided"]
13256 pub power_generated: f32,
13257 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
13258 pub bus_voltage: f32,
13259 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
13260 pub bat_current_setpoint: f32,
13261 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
13262 pub runtime: u32,
13263 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
13264 pub time_until_maintenance: i32,
13265 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
13266 pub generator_speed: u16,
13267 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
13268 pub rectifier_temperature: i16,
13269 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
13270 pub generator_temperature: i16,
13271}
13272impl GENERATOR_STATUS_DATA {
13273 pub const ENCODED_LEN: usize = 42usize;
13274 pub const DEFAULT: Self = Self {
13275 status: MavGeneratorStatusFlag::DEFAULT,
13276 battery_current: 0.0_f32,
13277 load_current: 0.0_f32,
13278 power_generated: 0.0_f32,
13279 bus_voltage: 0.0_f32,
13280 bat_current_setpoint: 0.0_f32,
13281 runtime: 0_u32,
13282 time_until_maintenance: 0_i32,
13283 generator_speed: 0_u16,
13284 rectifier_temperature: 0_i16,
13285 generator_temperature: 0_i16,
13286 };
13287 #[cfg(feature = "arbitrary")]
13288 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13289 use arbitrary::{Arbitrary, Unstructured};
13290 let mut buf = [0u8; 1024];
13291 rng.fill_bytes(&mut buf);
13292 let mut unstructured = Unstructured::new(&buf);
13293 Self::arbitrary(&mut unstructured).unwrap_or_default()
13294 }
13295}
13296impl Default for GENERATOR_STATUS_DATA {
13297 fn default() -> Self {
13298 Self::DEFAULT.clone()
13299 }
13300}
13301impl MessageData for GENERATOR_STATUS_DATA {
13302 type Message = MavMessage;
13303 const ID: u32 = 373u32;
13304 const NAME: &'static str = "GENERATOR_STATUS";
13305 const EXTRA_CRC: u8 = 117u8;
13306 const ENCODED_LEN: usize = 42usize;
13307 fn deser(
13308 _version: MavlinkVersion,
13309 __input: &[u8],
13310 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13311 let avail_len = __input.len();
13312 let mut payload_buf = [0; Self::ENCODED_LEN];
13313 let mut buf = if avail_len < Self::ENCODED_LEN {
13314 payload_buf[0..avail_len].copy_from_slice(__input);
13315 Bytes::new(&payload_buf)
13316 } else {
13317 Bytes::new(__input)
13318 };
13319 let mut __struct = Self::default();
13320 let tmp = buf.get_u64_le();
13321 __struct.status = MavGeneratorStatusFlag::from_bits(
13322 tmp & MavGeneratorStatusFlag::all().bits(),
13323 )
13324 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13325 flag_type: "MavGeneratorStatusFlag",
13326 value: tmp as u32,
13327 })?;
13328 __struct.battery_current = buf.get_f32_le();
13329 __struct.load_current = buf.get_f32_le();
13330 __struct.power_generated = buf.get_f32_le();
13331 __struct.bus_voltage = buf.get_f32_le();
13332 __struct.bat_current_setpoint = buf.get_f32_le();
13333 __struct.runtime = buf.get_u32_le();
13334 __struct.time_until_maintenance = buf.get_i32_le();
13335 __struct.generator_speed = buf.get_u16_le();
13336 __struct.rectifier_temperature = buf.get_i16_le();
13337 __struct.generator_temperature = buf.get_i16_le();
13338 Ok(__struct)
13339 }
13340 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13341 let mut __tmp = BytesMut::new(bytes);
13342 #[allow(clippy::absurd_extreme_comparisons)]
13343 #[allow(unused_comparisons)]
13344 if __tmp.remaining() < Self::ENCODED_LEN {
13345 panic!(
13346 "buffer is too small (need {} bytes, but got {})",
13347 Self::ENCODED_LEN,
13348 __tmp.remaining(),
13349 )
13350 }
13351 __tmp.put_u64_le(self.status.bits());
13352 __tmp.put_f32_le(self.battery_current);
13353 __tmp.put_f32_le(self.load_current);
13354 __tmp.put_f32_le(self.power_generated);
13355 __tmp.put_f32_le(self.bus_voltage);
13356 __tmp.put_f32_le(self.bat_current_setpoint);
13357 __tmp.put_u32_le(self.runtime);
13358 __tmp.put_i32_le(self.time_until_maintenance);
13359 __tmp.put_u16_le(self.generator_speed);
13360 __tmp.put_i16_le(self.rectifier_temperature);
13361 __tmp.put_i16_le(self.generator_temperature);
13362 if matches!(version, MavlinkVersion::V2) {
13363 let len = __tmp.len();
13364 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13365 } else {
13366 __tmp.len()
13367 }
13368 }
13369}
13370#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
13371#[doc = ""]
13372#[doc = "ID: 285"]
13373#[derive(Debug, Clone, PartialEq)]
13374#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13375#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13376#[cfg_attr(feature = "ts", derive(TS))]
13377#[cfg_attr(feature = "ts", ts(export))]
13378pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
13379 #[doc = "Timestamp (time since system boot)."]
13380 pub time_boot_ms: u32,
13381 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
13382 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13383 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13384 pub q: [f32; 4],
13385 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
13386 pub angular_velocity_x: f32,
13387 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
13388 pub angular_velocity_y: f32,
13389 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
13390 pub angular_velocity_z: f32,
13391 #[doc = "Failure flags (0 for no failure)"]
13392 pub failure_flags: GimbalDeviceErrorFlags,
13393 #[doc = "Current gimbal flags set."]
13394 pub flags: GimbalDeviceFlags,
13395 #[doc = "System ID"]
13396 pub target_system: u8,
13397 #[doc = "Component ID"]
13398 pub target_component: u8,
13399 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
13400 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13401 pub delta_yaw: f32,
13402 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
13403 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13404 pub delta_yaw_velocity: f32,
13405 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
13406 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13407 pub gimbal_device_id: u8,
13408}
13409impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
13410 pub const ENCODED_LEN: usize = 49usize;
13411 pub const DEFAULT: Self = Self {
13412 time_boot_ms: 0_u32,
13413 q: [0.0_f32; 4usize],
13414 angular_velocity_x: 0.0_f32,
13415 angular_velocity_y: 0.0_f32,
13416 angular_velocity_z: 0.0_f32,
13417 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
13418 flags: GimbalDeviceFlags::DEFAULT,
13419 target_system: 0_u8,
13420 target_component: 0_u8,
13421 delta_yaw: 0.0_f32,
13422 delta_yaw_velocity: 0.0_f32,
13423 gimbal_device_id: 0_u8,
13424 };
13425 #[cfg(feature = "arbitrary")]
13426 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13427 use arbitrary::{Arbitrary, Unstructured};
13428 let mut buf = [0u8; 1024];
13429 rng.fill_bytes(&mut buf);
13430 let mut unstructured = Unstructured::new(&buf);
13431 Self::arbitrary(&mut unstructured).unwrap_or_default()
13432 }
13433}
13434impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
13435 fn default() -> Self {
13436 Self::DEFAULT.clone()
13437 }
13438}
13439impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
13440 type Message = MavMessage;
13441 const ID: u32 = 285u32;
13442 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
13443 const EXTRA_CRC: u8 = 137u8;
13444 const ENCODED_LEN: usize = 49usize;
13445 fn deser(
13446 _version: MavlinkVersion,
13447 __input: &[u8],
13448 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13449 let avail_len = __input.len();
13450 let mut payload_buf = [0; Self::ENCODED_LEN];
13451 let mut buf = if avail_len < Self::ENCODED_LEN {
13452 payload_buf[0..avail_len].copy_from_slice(__input);
13453 Bytes::new(&payload_buf)
13454 } else {
13455 Bytes::new(__input)
13456 };
13457 let mut __struct = Self::default();
13458 __struct.time_boot_ms = buf.get_u32_le();
13459 for v in &mut __struct.q {
13460 let val = buf.get_f32_le();
13461 *v = val;
13462 }
13463 __struct.angular_velocity_x = buf.get_f32_le();
13464 __struct.angular_velocity_y = buf.get_f32_le();
13465 __struct.angular_velocity_z = buf.get_f32_le();
13466 let tmp = buf.get_u32_le();
13467 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
13468 tmp & GimbalDeviceErrorFlags::all().bits(),
13469 )
13470 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13471 flag_type: "GimbalDeviceErrorFlags",
13472 value: tmp as u32,
13473 })?;
13474 let tmp = buf.get_u16_le();
13475 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
13476 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13477 flag_type: "GimbalDeviceFlags",
13478 value: tmp as u32,
13479 })?;
13480 __struct.target_system = buf.get_u8();
13481 __struct.target_component = buf.get_u8();
13482 __struct.delta_yaw = buf.get_f32_le();
13483 __struct.delta_yaw_velocity = buf.get_f32_le();
13484 __struct.gimbal_device_id = buf.get_u8();
13485 Ok(__struct)
13486 }
13487 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13488 let mut __tmp = BytesMut::new(bytes);
13489 #[allow(clippy::absurd_extreme_comparisons)]
13490 #[allow(unused_comparisons)]
13491 if __tmp.remaining() < Self::ENCODED_LEN {
13492 panic!(
13493 "buffer is too small (need {} bytes, but got {})",
13494 Self::ENCODED_LEN,
13495 __tmp.remaining(),
13496 )
13497 }
13498 __tmp.put_u32_le(self.time_boot_ms);
13499 for val in &self.q {
13500 __tmp.put_f32_le(*val);
13501 }
13502 __tmp.put_f32_le(self.angular_velocity_x);
13503 __tmp.put_f32_le(self.angular_velocity_y);
13504 __tmp.put_f32_le(self.angular_velocity_z);
13505 __tmp.put_u32_le(self.failure_flags.bits());
13506 __tmp.put_u16_le(self.flags.bits());
13507 __tmp.put_u8(self.target_system);
13508 __tmp.put_u8(self.target_component);
13509 if matches!(version, MavlinkVersion::V2) {
13510 __tmp.put_f32_le(self.delta_yaw);
13511 __tmp.put_f32_le(self.delta_yaw_velocity);
13512 __tmp.put_u8(self.gimbal_device_id);
13513 let len = __tmp.len();
13514 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13515 } else {
13516 __tmp.len()
13517 }
13518 }
13519}
13520#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
13521#[doc = ""]
13522#[doc = "ID: 283"]
13523#[derive(Debug, Clone, PartialEq)]
13524#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13525#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13526#[cfg_attr(feature = "ts", derive(TS))]
13527#[cfg_attr(feature = "ts", ts(export))]
13528pub struct GIMBAL_DEVICE_INFORMATION_DATA {
13529 #[doc = "UID of gimbal hardware (0 if unknown)."]
13530 pub uid: u64,
13531 #[doc = "Timestamp (time since system boot)."]
13532 pub time_boot_ms: u32,
13533 #[doc = "0xff)."]
13534 pub firmware_version: u32,
13535 #[doc = "0xff)."]
13536 pub hardware_version: u32,
13537 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
13538 pub roll_min: f32,
13539 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
13540 pub roll_max: f32,
13541 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
13542 pub pitch_min: f32,
13543 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
13544 pub pitch_max: f32,
13545 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
13546 pub yaw_min: f32,
13547 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
13548 pub yaw_max: f32,
13549 #[doc = "Bitmap of gimbal capability flags."]
13550 pub cap_flags: GimbalDeviceCapFlags,
13551 #[doc = "Bitmap for use for gimbal-specific capability flags."]
13552 pub custom_cap_flags: u16,
13553 #[doc = "Name of the gimbal vendor."]
13554 #[cfg_attr(feature = "ts", ts(type = "string"))]
13555 pub vendor_name: CharArray<32>,
13556 #[doc = "Name of the gimbal model."]
13557 #[cfg_attr(feature = "ts", ts(type = "string"))]
13558 pub model_name: CharArray<32>,
13559 #[doc = "Custom name of the gimbal given to it by the user."]
13560 #[cfg_attr(feature = "ts", ts(type = "string"))]
13561 pub custom_name: CharArray<32>,
13562 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
13563 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13564 pub gimbal_device_id: u8,
13565}
13566impl GIMBAL_DEVICE_INFORMATION_DATA {
13567 pub const ENCODED_LEN: usize = 145usize;
13568 pub const DEFAULT: Self = Self {
13569 uid: 0_u64,
13570 time_boot_ms: 0_u32,
13571 firmware_version: 0_u32,
13572 hardware_version: 0_u32,
13573 roll_min: 0.0_f32,
13574 roll_max: 0.0_f32,
13575 pitch_min: 0.0_f32,
13576 pitch_max: 0.0_f32,
13577 yaw_min: 0.0_f32,
13578 yaw_max: 0.0_f32,
13579 cap_flags: GimbalDeviceCapFlags::DEFAULT,
13580 custom_cap_flags: 0_u16,
13581 vendor_name: CharArray::new([0_u8; 32usize]),
13582 model_name: CharArray::new([0_u8; 32usize]),
13583 custom_name: CharArray::new([0_u8; 32usize]),
13584 gimbal_device_id: 0_u8,
13585 };
13586 #[cfg(feature = "arbitrary")]
13587 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13588 use arbitrary::{Arbitrary, Unstructured};
13589 let mut buf = [0u8; 1024];
13590 rng.fill_bytes(&mut buf);
13591 let mut unstructured = Unstructured::new(&buf);
13592 Self::arbitrary(&mut unstructured).unwrap_or_default()
13593 }
13594}
13595impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
13596 fn default() -> Self {
13597 Self::DEFAULT.clone()
13598 }
13599}
13600impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
13601 type Message = MavMessage;
13602 const ID: u32 = 283u32;
13603 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
13604 const EXTRA_CRC: u8 = 74u8;
13605 const ENCODED_LEN: usize = 145usize;
13606 fn deser(
13607 _version: MavlinkVersion,
13608 __input: &[u8],
13609 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13610 let avail_len = __input.len();
13611 let mut payload_buf = [0; Self::ENCODED_LEN];
13612 let mut buf = if avail_len < Self::ENCODED_LEN {
13613 payload_buf[0..avail_len].copy_from_slice(__input);
13614 Bytes::new(&payload_buf)
13615 } else {
13616 Bytes::new(__input)
13617 };
13618 let mut __struct = Self::default();
13619 __struct.uid = buf.get_u64_le();
13620 __struct.time_boot_ms = buf.get_u32_le();
13621 __struct.firmware_version = buf.get_u32_le();
13622 __struct.hardware_version = buf.get_u32_le();
13623 __struct.roll_min = buf.get_f32_le();
13624 __struct.roll_max = buf.get_f32_le();
13625 __struct.pitch_min = buf.get_f32_le();
13626 __struct.pitch_max = buf.get_f32_le();
13627 __struct.yaw_min = buf.get_f32_le();
13628 __struct.yaw_max = buf.get_f32_le();
13629 let tmp = buf.get_u16_le();
13630 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
13631 tmp & GimbalDeviceCapFlags::all().bits(),
13632 )
13633 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13634 flag_type: "GimbalDeviceCapFlags",
13635 value: tmp as u32,
13636 })?;
13637 __struct.custom_cap_flags = buf.get_u16_le();
13638 let mut tmp = [0_u8; 32usize];
13639 for v in &mut tmp {
13640 *v = buf.get_u8();
13641 }
13642 __struct.vendor_name = CharArray::new(tmp);
13643 let mut tmp = [0_u8; 32usize];
13644 for v in &mut tmp {
13645 *v = buf.get_u8();
13646 }
13647 __struct.model_name = CharArray::new(tmp);
13648 let mut tmp = [0_u8; 32usize];
13649 for v in &mut tmp {
13650 *v = buf.get_u8();
13651 }
13652 __struct.custom_name = CharArray::new(tmp);
13653 __struct.gimbal_device_id = buf.get_u8();
13654 Ok(__struct)
13655 }
13656 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13657 let mut __tmp = BytesMut::new(bytes);
13658 #[allow(clippy::absurd_extreme_comparisons)]
13659 #[allow(unused_comparisons)]
13660 if __tmp.remaining() < Self::ENCODED_LEN {
13661 panic!(
13662 "buffer is too small (need {} bytes, but got {})",
13663 Self::ENCODED_LEN,
13664 __tmp.remaining(),
13665 )
13666 }
13667 __tmp.put_u64_le(self.uid);
13668 __tmp.put_u32_le(self.time_boot_ms);
13669 __tmp.put_u32_le(self.firmware_version);
13670 __tmp.put_u32_le(self.hardware_version);
13671 __tmp.put_f32_le(self.roll_min);
13672 __tmp.put_f32_le(self.roll_max);
13673 __tmp.put_f32_le(self.pitch_min);
13674 __tmp.put_f32_le(self.pitch_max);
13675 __tmp.put_f32_le(self.yaw_min);
13676 __tmp.put_f32_le(self.yaw_max);
13677 __tmp.put_u16_le(self.cap_flags.bits());
13678 __tmp.put_u16_le(self.custom_cap_flags);
13679 for val in &self.vendor_name {
13680 __tmp.put_u8(*val);
13681 }
13682 for val in &self.model_name {
13683 __tmp.put_u8(*val);
13684 }
13685 for val in &self.custom_name {
13686 __tmp.put_u8(*val);
13687 }
13688 if matches!(version, MavlinkVersion::V2) {
13689 __tmp.put_u8(self.gimbal_device_id);
13690 let len = __tmp.len();
13691 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13692 } else {
13693 __tmp.len()
13694 }
13695 }
13696}
13697#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
13698#[doc = ""]
13699#[doc = "ID: 284"]
13700#[derive(Debug, Clone, PartialEq)]
13701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13702#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13703#[cfg_attr(feature = "ts", derive(TS))]
13704#[cfg_attr(feature = "ts", ts(export))]
13705pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13706 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
13707 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13708 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13709 pub q: [f32; 4],
13710 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
13711 pub angular_velocity_x: f32,
13712 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
13713 pub angular_velocity_y: f32,
13714 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
13715 pub angular_velocity_z: f32,
13716 #[doc = "Low level gimbal flags."]
13717 pub flags: GimbalDeviceFlags,
13718 #[doc = "System ID"]
13719 pub target_system: u8,
13720 #[doc = "Component ID"]
13721 pub target_component: u8,
13722}
13723impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13724 pub const ENCODED_LEN: usize = 32usize;
13725 pub const DEFAULT: Self = Self {
13726 q: [0.0_f32; 4usize],
13727 angular_velocity_x: 0.0_f32,
13728 angular_velocity_y: 0.0_f32,
13729 angular_velocity_z: 0.0_f32,
13730 flags: GimbalDeviceFlags::DEFAULT,
13731 target_system: 0_u8,
13732 target_component: 0_u8,
13733 };
13734 #[cfg(feature = "arbitrary")]
13735 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13736 use arbitrary::{Arbitrary, Unstructured};
13737 let mut buf = [0u8; 1024];
13738 rng.fill_bytes(&mut buf);
13739 let mut unstructured = Unstructured::new(&buf);
13740 Self::arbitrary(&mut unstructured).unwrap_or_default()
13741 }
13742}
13743impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13744 fn default() -> Self {
13745 Self::DEFAULT.clone()
13746 }
13747}
13748impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13749 type Message = MavMessage;
13750 const ID: u32 = 284u32;
13751 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
13752 const EXTRA_CRC: u8 = 99u8;
13753 const ENCODED_LEN: usize = 32usize;
13754 fn deser(
13755 _version: MavlinkVersion,
13756 __input: &[u8],
13757 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13758 let avail_len = __input.len();
13759 let mut payload_buf = [0; Self::ENCODED_LEN];
13760 let mut buf = if avail_len < Self::ENCODED_LEN {
13761 payload_buf[0..avail_len].copy_from_slice(__input);
13762 Bytes::new(&payload_buf)
13763 } else {
13764 Bytes::new(__input)
13765 };
13766 let mut __struct = Self::default();
13767 for v in &mut __struct.q {
13768 let val = buf.get_f32_le();
13769 *v = val;
13770 }
13771 __struct.angular_velocity_x = buf.get_f32_le();
13772 __struct.angular_velocity_y = buf.get_f32_le();
13773 __struct.angular_velocity_z = buf.get_f32_le();
13774 let tmp = buf.get_u16_le();
13775 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
13776 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13777 flag_type: "GimbalDeviceFlags",
13778 value: tmp as u32,
13779 })?;
13780 __struct.target_system = buf.get_u8();
13781 __struct.target_component = buf.get_u8();
13782 Ok(__struct)
13783 }
13784 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13785 let mut __tmp = BytesMut::new(bytes);
13786 #[allow(clippy::absurd_extreme_comparisons)]
13787 #[allow(unused_comparisons)]
13788 if __tmp.remaining() < Self::ENCODED_LEN {
13789 panic!(
13790 "buffer is too small (need {} bytes, but got {})",
13791 Self::ENCODED_LEN,
13792 __tmp.remaining(),
13793 )
13794 }
13795 for val in &self.q {
13796 __tmp.put_f32_le(*val);
13797 }
13798 __tmp.put_f32_le(self.angular_velocity_x);
13799 __tmp.put_f32_le(self.angular_velocity_y);
13800 __tmp.put_f32_le(self.angular_velocity_z);
13801 __tmp.put_u16_le(self.flags.bits());
13802 __tmp.put_u8(self.target_system);
13803 __tmp.put_u8(self.target_component);
13804 if matches!(version, MavlinkVersion::V2) {
13805 let len = __tmp.len();
13806 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13807 } else {
13808 __tmp.len()
13809 }
13810 }
13811}
13812#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
13813#[doc = ""]
13814#[doc = "ID: 280"]
13815#[derive(Debug, Clone, PartialEq)]
13816#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13817#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13818#[cfg_attr(feature = "ts", derive(TS))]
13819#[cfg_attr(feature = "ts", ts(export))]
13820pub struct GIMBAL_MANAGER_INFORMATION_DATA {
13821 #[doc = "Timestamp (time since system boot)."]
13822 pub time_boot_ms: u32,
13823 #[doc = "Bitmap of gimbal capability flags."]
13824 pub cap_flags: GimbalManagerCapFlags,
13825 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
13826 pub roll_min: f32,
13827 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
13828 pub roll_max: f32,
13829 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
13830 pub pitch_min: f32,
13831 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
13832 pub pitch_max: f32,
13833 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
13834 pub yaw_min: f32,
13835 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
13836 pub yaw_max: f32,
13837 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13838 pub gimbal_device_id: u8,
13839}
13840impl GIMBAL_MANAGER_INFORMATION_DATA {
13841 pub const ENCODED_LEN: usize = 33usize;
13842 pub const DEFAULT: Self = Self {
13843 time_boot_ms: 0_u32,
13844 cap_flags: GimbalManagerCapFlags::DEFAULT,
13845 roll_min: 0.0_f32,
13846 roll_max: 0.0_f32,
13847 pitch_min: 0.0_f32,
13848 pitch_max: 0.0_f32,
13849 yaw_min: 0.0_f32,
13850 yaw_max: 0.0_f32,
13851 gimbal_device_id: 0_u8,
13852 };
13853 #[cfg(feature = "arbitrary")]
13854 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13855 use arbitrary::{Arbitrary, Unstructured};
13856 let mut buf = [0u8; 1024];
13857 rng.fill_bytes(&mut buf);
13858 let mut unstructured = Unstructured::new(&buf);
13859 Self::arbitrary(&mut unstructured).unwrap_or_default()
13860 }
13861}
13862impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
13863 fn default() -> Self {
13864 Self::DEFAULT.clone()
13865 }
13866}
13867impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
13868 type Message = MavMessage;
13869 const ID: u32 = 280u32;
13870 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
13871 const EXTRA_CRC: u8 = 70u8;
13872 const ENCODED_LEN: usize = 33usize;
13873 fn deser(
13874 _version: MavlinkVersion,
13875 __input: &[u8],
13876 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13877 let avail_len = __input.len();
13878 let mut payload_buf = [0; Self::ENCODED_LEN];
13879 let mut buf = if avail_len < Self::ENCODED_LEN {
13880 payload_buf[0..avail_len].copy_from_slice(__input);
13881 Bytes::new(&payload_buf)
13882 } else {
13883 Bytes::new(__input)
13884 };
13885 let mut __struct = Self::default();
13886 __struct.time_boot_ms = buf.get_u32_le();
13887 let tmp = buf.get_u32_le();
13888 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
13889 tmp & GimbalManagerCapFlags::all().bits(),
13890 )
13891 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13892 flag_type: "GimbalManagerCapFlags",
13893 value: tmp as u32,
13894 })?;
13895 __struct.roll_min = buf.get_f32_le();
13896 __struct.roll_max = buf.get_f32_le();
13897 __struct.pitch_min = buf.get_f32_le();
13898 __struct.pitch_max = buf.get_f32_le();
13899 __struct.yaw_min = buf.get_f32_le();
13900 __struct.yaw_max = buf.get_f32_le();
13901 __struct.gimbal_device_id = buf.get_u8();
13902 Ok(__struct)
13903 }
13904 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13905 let mut __tmp = BytesMut::new(bytes);
13906 #[allow(clippy::absurd_extreme_comparisons)]
13907 #[allow(unused_comparisons)]
13908 if __tmp.remaining() < Self::ENCODED_LEN {
13909 panic!(
13910 "buffer is too small (need {} bytes, but got {})",
13911 Self::ENCODED_LEN,
13912 __tmp.remaining(),
13913 )
13914 }
13915 __tmp.put_u32_le(self.time_boot_ms);
13916 __tmp.put_u32_le(self.cap_flags.bits());
13917 __tmp.put_f32_le(self.roll_min);
13918 __tmp.put_f32_le(self.roll_max);
13919 __tmp.put_f32_le(self.pitch_min);
13920 __tmp.put_f32_le(self.pitch_max);
13921 __tmp.put_f32_le(self.yaw_min);
13922 __tmp.put_f32_le(self.yaw_max);
13923 __tmp.put_u8(self.gimbal_device_id);
13924 if matches!(version, MavlinkVersion::V2) {
13925 let len = __tmp.len();
13926 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13927 } else {
13928 __tmp.len()
13929 }
13930 }
13931}
13932#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13933#[doc = ""]
13934#[doc = "ID: 282"]
13935#[derive(Debug, Clone, PartialEq)]
13936#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13937#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13938#[cfg_attr(feature = "ts", derive(TS))]
13939#[cfg_attr(feature = "ts", ts(export))]
13940pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13941 #[doc = "High level gimbal manager flags to use."]
13942 pub flags: GimbalManagerFlags,
13943 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
13944 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13945 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13946 pub q: [f32; 4],
13947 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
13948 pub angular_velocity_x: f32,
13949 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
13950 pub angular_velocity_y: f32,
13951 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
13952 pub angular_velocity_z: f32,
13953 #[doc = "System ID"]
13954 pub target_system: u8,
13955 #[doc = "Component ID"]
13956 pub target_component: u8,
13957 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13958 pub gimbal_device_id: u8,
13959}
13960impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13961 pub const ENCODED_LEN: usize = 35usize;
13962 pub const DEFAULT: Self = Self {
13963 flags: GimbalManagerFlags::DEFAULT,
13964 q: [0.0_f32; 4usize],
13965 angular_velocity_x: 0.0_f32,
13966 angular_velocity_y: 0.0_f32,
13967 angular_velocity_z: 0.0_f32,
13968 target_system: 0_u8,
13969 target_component: 0_u8,
13970 gimbal_device_id: 0_u8,
13971 };
13972 #[cfg(feature = "arbitrary")]
13973 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13974 use arbitrary::{Arbitrary, Unstructured};
13975 let mut buf = [0u8; 1024];
13976 rng.fill_bytes(&mut buf);
13977 let mut unstructured = Unstructured::new(&buf);
13978 Self::arbitrary(&mut unstructured).unwrap_or_default()
13979 }
13980}
13981impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13982 fn default() -> Self {
13983 Self::DEFAULT.clone()
13984 }
13985}
13986impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13987 type Message = MavMessage;
13988 const ID: u32 = 282u32;
13989 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
13990 const EXTRA_CRC: u8 = 123u8;
13991 const ENCODED_LEN: usize = 35usize;
13992 fn deser(
13993 _version: MavlinkVersion,
13994 __input: &[u8],
13995 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13996 let avail_len = __input.len();
13997 let mut payload_buf = [0; Self::ENCODED_LEN];
13998 let mut buf = if avail_len < Self::ENCODED_LEN {
13999 payload_buf[0..avail_len].copy_from_slice(__input);
14000 Bytes::new(&payload_buf)
14001 } else {
14002 Bytes::new(__input)
14003 };
14004 let mut __struct = Self::default();
14005 let tmp = buf.get_u32_le();
14006 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
14007 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14008 flag_type: "GimbalManagerFlags",
14009 value: tmp as u32,
14010 })?;
14011 for v in &mut __struct.q {
14012 let val = buf.get_f32_le();
14013 *v = val;
14014 }
14015 __struct.angular_velocity_x = buf.get_f32_le();
14016 __struct.angular_velocity_y = buf.get_f32_le();
14017 __struct.angular_velocity_z = buf.get_f32_le();
14018 __struct.target_system = buf.get_u8();
14019 __struct.target_component = buf.get_u8();
14020 __struct.gimbal_device_id = buf.get_u8();
14021 Ok(__struct)
14022 }
14023 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14024 let mut __tmp = BytesMut::new(bytes);
14025 #[allow(clippy::absurd_extreme_comparisons)]
14026 #[allow(unused_comparisons)]
14027 if __tmp.remaining() < Self::ENCODED_LEN {
14028 panic!(
14029 "buffer is too small (need {} bytes, but got {})",
14030 Self::ENCODED_LEN,
14031 __tmp.remaining(),
14032 )
14033 }
14034 __tmp.put_u32_le(self.flags.bits());
14035 for val in &self.q {
14036 __tmp.put_f32_le(*val);
14037 }
14038 __tmp.put_f32_le(self.angular_velocity_x);
14039 __tmp.put_f32_le(self.angular_velocity_y);
14040 __tmp.put_f32_le(self.angular_velocity_z);
14041 __tmp.put_u8(self.target_system);
14042 __tmp.put_u8(self.target_component);
14043 __tmp.put_u8(self.gimbal_device_id);
14044 if matches!(version, MavlinkVersion::V2) {
14045 let len = __tmp.len();
14046 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14047 } else {
14048 __tmp.len()
14049 }
14050 }
14051}
14052#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
14053#[doc = ""]
14054#[doc = "ID: 288"]
14055#[derive(Debug, Clone, PartialEq)]
14056#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14057#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14058#[cfg_attr(feature = "ts", derive(TS))]
14059#[cfg_attr(feature = "ts", ts(export))]
14060pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
14061 #[doc = "High level gimbal manager flags."]
14062 pub flags: GimbalManagerFlags,
14063 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
14064 pub pitch: f32,
14065 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
14066 pub yaw: f32,
14067 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
14068 pub pitch_rate: f32,
14069 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
14070 pub yaw_rate: f32,
14071 #[doc = "System ID"]
14072 pub target_system: u8,
14073 #[doc = "Component ID"]
14074 pub target_component: u8,
14075 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
14076 pub gimbal_device_id: u8,
14077}
14078impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
14079 pub const ENCODED_LEN: usize = 23usize;
14080 pub const DEFAULT: Self = Self {
14081 flags: GimbalManagerFlags::DEFAULT,
14082 pitch: 0.0_f32,
14083 yaw: 0.0_f32,
14084 pitch_rate: 0.0_f32,
14085 yaw_rate: 0.0_f32,
14086 target_system: 0_u8,
14087 target_component: 0_u8,
14088 gimbal_device_id: 0_u8,
14089 };
14090 #[cfg(feature = "arbitrary")]
14091 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14092 use arbitrary::{Arbitrary, Unstructured};
14093 let mut buf = [0u8; 1024];
14094 rng.fill_bytes(&mut buf);
14095 let mut unstructured = Unstructured::new(&buf);
14096 Self::arbitrary(&mut unstructured).unwrap_or_default()
14097 }
14098}
14099impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
14100 fn default() -> Self {
14101 Self::DEFAULT.clone()
14102 }
14103}
14104impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
14105 type Message = MavMessage;
14106 const ID: u32 = 288u32;
14107 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
14108 const EXTRA_CRC: u8 = 20u8;
14109 const ENCODED_LEN: usize = 23usize;
14110 fn deser(
14111 _version: MavlinkVersion,
14112 __input: &[u8],
14113 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14114 let avail_len = __input.len();
14115 let mut payload_buf = [0; Self::ENCODED_LEN];
14116 let mut buf = if avail_len < Self::ENCODED_LEN {
14117 payload_buf[0..avail_len].copy_from_slice(__input);
14118 Bytes::new(&payload_buf)
14119 } else {
14120 Bytes::new(__input)
14121 };
14122 let mut __struct = Self::default();
14123 let tmp = buf.get_u32_le();
14124 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
14125 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14126 flag_type: "GimbalManagerFlags",
14127 value: tmp as u32,
14128 })?;
14129 __struct.pitch = buf.get_f32_le();
14130 __struct.yaw = buf.get_f32_le();
14131 __struct.pitch_rate = buf.get_f32_le();
14132 __struct.yaw_rate = buf.get_f32_le();
14133 __struct.target_system = buf.get_u8();
14134 __struct.target_component = buf.get_u8();
14135 __struct.gimbal_device_id = buf.get_u8();
14136 Ok(__struct)
14137 }
14138 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14139 let mut __tmp = BytesMut::new(bytes);
14140 #[allow(clippy::absurd_extreme_comparisons)]
14141 #[allow(unused_comparisons)]
14142 if __tmp.remaining() < Self::ENCODED_LEN {
14143 panic!(
14144 "buffer is too small (need {} bytes, but got {})",
14145 Self::ENCODED_LEN,
14146 __tmp.remaining(),
14147 )
14148 }
14149 __tmp.put_u32_le(self.flags.bits());
14150 __tmp.put_f32_le(self.pitch);
14151 __tmp.put_f32_le(self.yaw);
14152 __tmp.put_f32_le(self.pitch_rate);
14153 __tmp.put_f32_le(self.yaw_rate);
14154 __tmp.put_u8(self.target_system);
14155 __tmp.put_u8(self.target_component);
14156 __tmp.put_u8(self.gimbal_device_id);
14157 if matches!(version, MavlinkVersion::V2) {
14158 let len = __tmp.len();
14159 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14160 } else {
14161 __tmp.len()
14162 }
14163 }
14164}
14165#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
14166#[doc = ""]
14167#[doc = "ID: 287"]
14168#[derive(Debug, Clone, PartialEq)]
14169#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14170#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14171#[cfg_attr(feature = "ts", derive(TS))]
14172#[cfg_attr(feature = "ts", ts(export))]
14173pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
14174 #[doc = "High level gimbal manager flags to use."]
14175 pub flags: GimbalManagerFlags,
14176 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
14177 pub pitch: f32,
14178 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
14179 pub yaw: f32,
14180 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
14181 pub pitch_rate: f32,
14182 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
14183 pub yaw_rate: f32,
14184 #[doc = "System ID"]
14185 pub target_system: u8,
14186 #[doc = "Component ID"]
14187 pub target_component: u8,
14188 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
14189 pub gimbal_device_id: u8,
14190}
14191impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
14192 pub const ENCODED_LEN: usize = 23usize;
14193 pub const DEFAULT: Self = Self {
14194 flags: GimbalManagerFlags::DEFAULT,
14195 pitch: 0.0_f32,
14196 yaw: 0.0_f32,
14197 pitch_rate: 0.0_f32,
14198 yaw_rate: 0.0_f32,
14199 target_system: 0_u8,
14200 target_component: 0_u8,
14201 gimbal_device_id: 0_u8,
14202 };
14203 #[cfg(feature = "arbitrary")]
14204 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14205 use arbitrary::{Arbitrary, Unstructured};
14206 let mut buf = [0u8; 1024];
14207 rng.fill_bytes(&mut buf);
14208 let mut unstructured = Unstructured::new(&buf);
14209 Self::arbitrary(&mut unstructured).unwrap_or_default()
14210 }
14211}
14212impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
14213 fn default() -> Self {
14214 Self::DEFAULT.clone()
14215 }
14216}
14217impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
14218 type Message = MavMessage;
14219 const ID: u32 = 287u32;
14220 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
14221 const EXTRA_CRC: u8 = 1u8;
14222 const ENCODED_LEN: usize = 23usize;
14223 fn deser(
14224 _version: MavlinkVersion,
14225 __input: &[u8],
14226 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14227 let avail_len = __input.len();
14228 let mut payload_buf = [0; Self::ENCODED_LEN];
14229 let mut buf = if avail_len < Self::ENCODED_LEN {
14230 payload_buf[0..avail_len].copy_from_slice(__input);
14231 Bytes::new(&payload_buf)
14232 } else {
14233 Bytes::new(__input)
14234 };
14235 let mut __struct = Self::default();
14236 let tmp = buf.get_u32_le();
14237 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
14238 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14239 flag_type: "GimbalManagerFlags",
14240 value: tmp as u32,
14241 })?;
14242 __struct.pitch = buf.get_f32_le();
14243 __struct.yaw = buf.get_f32_le();
14244 __struct.pitch_rate = buf.get_f32_le();
14245 __struct.yaw_rate = buf.get_f32_le();
14246 __struct.target_system = buf.get_u8();
14247 __struct.target_component = buf.get_u8();
14248 __struct.gimbal_device_id = buf.get_u8();
14249 Ok(__struct)
14250 }
14251 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14252 let mut __tmp = BytesMut::new(bytes);
14253 #[allow(clippy::absurd_extreme_comparisons)]
14254 #[allow(unused_comparisons)]
14255 if __tmp.remaining() < Self::ENCODED_LEN {
14256 panic!(
14257 "buffer is too small (need {} bytes, but got {})",
14258 Self::ENCODED_LEN,
14259 __tmp.remaining(),
14260 )
14261 }
14262 __tmp.put_u32_le(self.flags.bits());
14263 __tmp.put_f32_le(self.pitch);
14264 __tmp.put_f32_le(self.yaw);
14265 __tmp.put_f32_le(self.pitch_rate);
14266 __tmp.put_f32_le(self.yaw_rate);
14267 __tmp.put_u8(self.target_system);
14268 __tmp.put_u8(self.target_component);
14269 __tmp.put_u8(self.gimbal_device_id);
14270 if matches!(version, MavlinkVersion::V2) {
14271 let len = __tmp.len();
14272 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14273 } else {
14274 __tmp.len()
14275 }
14276 }
14277}
14278#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
14279#[doc = ""]
14280#[doc = "ID: 281"]
14281#[derive(Debug, Clone, PartialEq)]
14282#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14283#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14284#[cfg_attr(feature = "ts", derive(TS))]
14285#[cfg_attr(feature = "ts", ts(export))]
14286pub struct GIMBAL_MANAGER_STATUS_DATA {
14287 #[doc = "Timestamp (time since system boot)."]
14288 pub time_boot_ms: u32,
14289 #[doc = "High level gimbal manager flags currently applied."]
14290 pub flags: GimbalManagerFlags,
14291 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
14292 pub gimbal_device_id: u8,
14293 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
14294 pub primary_control_sysid: u8,
14295 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
14296 pub primary_control_compid: u8,
14297 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
14298 pub secondary_control_sysid: u8,
14299 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
14300 pub secondary_control_compid: u8,
14301}
14302impl GIMBAL_MANAGER_STATUS_DATA {
14303 pub const ENCODED_LEN: usize = 13usize;
14304 pub const DEFAULT: Self = Self {
14305 time_boot_ms: 0_u32,
14306 flags: GimbalManagerFlags::DEFAULT,
14307 gimbal_device_id: 0_u8,
14308 primary_control_sysid: 0_u8,
14309 primary_control_compid: 0_u8,
14310 secondary_control_sysid: 0_u8,
14311 secondary_control_compid: 0_u8,
14312 };
14313 #[cfg(feature = "arbitrary")]
14314 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14315 use arbitrary::{Arbitrary, Unstructured};
14316 let mut buf = [0u8; 1024];
14317 rng.fill_bytes(&mut buf);
14318 let mut unstructured = Unstructured::new(&buf);
14319 Self::arbitrary(&mut unstructured).unwrap_or_default()
14320 }
14321}
14322impl Default for GIMBAL_MANAGER_STATUS_DATA {
14323 fn default() -> Self {
14324 Self::DEFAULT.clone()
14325 }
14326}
14327impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
14328 type Message = MavMessage;
14329 const ID: u32 = 281u32;
14330 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
14331 const EXTRA_CRC: u8 = 48u8;
14332 const ENCODED_LEN: usize = 13usize;
14333 fn deser(
14334 _version: MavlinkVersion,
14335 __input: &[u8],
14336 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14337 let avail_len = __input.len();
14338 let mut payload_buf = [0; Self::ENCODED_LEN];
14339 let mut buf = if avail_len < Self::ENCODED_LEN {
14340 payload_buf[0..avail_len].copy_from_slice(__input);
14341 Bytes::new(&payload_buf)
14342 } else {
14343 Bytes::new(__input)
14344 };
14345 let mut __struct = Self::default();
14346 __struct.time_boot_ms = buf.get_u32_le();
14347 let tmp = buf.get_u32_le();
14348 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
14349 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14350 flag_type: "GimbalManagerFlags",
14351 value: tmp as u32,
14352 })?;
14353 __struct.gimbal_device_id = buf.get_u8();
14354 __struct.primary_control_sysid = buf.get_u8();
14355 __struct.primary_control_compid = buf.get_u8();
14356 __struct.secondary_control_sysid = buf.get_u8();
14357 __struct.secondary_control_compid = buf.get_u8();
14358 Ok(__struct)
14359 }
14360 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14361 let mut __tmp = BytesMut::new(bytes);
14362 #[allow(clippy::absurd_extreme_comparisons)]
14363 #[allow(unused_comparisons)]
14364 if __tmp.remaining() < Self::ENCODED_LEN {
14365 panic!(
14366 "buffer is too small (need {} bytes, but got {})",
14367 Self::ENCODED_LEN,
14368 __tmp.remaining(),
14369 )
14370 }
14371 __tmp.put_u32_le(self.time_boot_ms);
14372 __tmp.put_u32_le(self.flags.bits());
14373 __tmp.put_u8(self.gimbal_device_id);
14374 __tmp.put_u8(self.primary_control_sysid);
14375 __tmp.put_u8(self.primary_control_compid);
14376 __tmp.put_u8(self.secondary_control_sysid);
14377 __tmp.put_u8(self.secondary_control_compid);
14378 if matches!(version, MavlinkVersion::V2) {
14379 let len = __tmp.len();
14380 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14381 } else {
14382 __tmp.len()
14383 }
14384 }
14385}
14386#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
14387#[doc = ""]
14388#[doc = "ID: 33"]
14389#[derive(Debug, Clone, PartialEq)]
14390#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14391#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14392#[cfg_attr(feature = "ts", derive(TS))]
14393#[cfg_attr(feature = "ts", ts(export))]
14394pub struct GLOBAL_POSITION_INT_DATA {
14395 #[doc = "Timestamp (time since system boot)."]
14396 pub time_boot_ms: u32,
14397 #[doc = "Latitude, expressed"]
14398 pub lat: i32,
14399 #[doc = "Longitude, expressed"]
14400 pub lon: i32,
14401 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
14402 pub alt: i32,
14403 #[doc = "Altitude above home"]
14404 pub relative_alt: i32,
14405 #[doc = "Ground X Speed (Latitude, positive north)"]
14406 pub vx: i16,
14407 #[doc = "Ground Y Speed (Longitude, positive east)"]
14408 pub vy: i16,
14409 #[doc = "Ground Z Speed (Altitude, positive down)"]
14410 pub vz: i16,
14411 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14412 pub hdg: u16,
14413}
14414impl GLOBAL_POSITION_INT_DATA {
14415 pub const ENCODED_LEN: usize = 28usize;
14416 pub const DEFAULT: Self = Self {
14417 time_boot_ms: 0_u32,
14418 lat: 0_i32,
14419 lon: 0_i32,
14420 alt: 0_i32,
14421 relative_alt: 0_i32,
14422 vx: 0_i16,
14423 vy: 0_i16,
14424 vz: 0_i16,
14425 hdg: 0_u16,
14426 };
14427 #[cfg(feature = "arbitrary")]
14428 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14429 use arbitrary::{Arbitrary, Unstructured};
14430 let mut buf = [0u8; 1024];
14431 rng.fill_bytes(&mut buf);
14432 let mut unstructured = Unstructured::new(&buf);
14433 Self::arbitrary(&mut unstructured).unwrap_or_default()
14434 }
14435}
14436impl Default for GLOBAL_POSITION_INT_DATA {
14437 fn default() -> Self {
14438 Self::DEFAULT.clone()
14439 }
14440}
14441impl MessageData for GLOBAL_POSITION_INT_DATA {
14442 type Message = MavMessage;
14443 const ID: u32 = 33u32;
14444 const NAME: &'static str = "GLOBAL_POSITION_INT";
14445 const EXTRA_CRC: u8 = 104u8;
14446 const ENCODED_LEN: usize = 28usize;
14447 fn deser(
14448 _version: MavlinkVersion,
14449 __input: &[u8],
14450 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14451 let avail_len = __input.len();
14452 let mut payload_buf = [0; Self::ENCODED_LEN];
14453 let mut buf = if avail_len < Self::ENCODED_LEN {
14454 payload_buf[0..avail_len].copy_from_slice(__input);
14455 Bytes::new(&payload_buf)
14456 } else {
14457 Bytes::new(__input)
14458 };
14459 let mut __struct = Self::default();
14460 __struct.time_boot_ms = buf.get_u32_le();
14461 __struct.lat = buf.get_i32_le();
14462 __struct.lon = buf.get_i32_le();
14463 __struct.alt = buf.get_i32_le();
14464 __struct.relative_alt = buf.get_i32_le();
14465 __struct.vx = buf.get_i16_le();
14466 __struct.vy = buf.get_i16_le();
14467 __struct.vz = buf.get_i16_le();
14468 __struct.hdg = buf.get_u16_le();
14469 Ok(__struct)
14470 }
14471 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14472 let mut __tmp = BytesMut::new(bytes);
14473 #[allow(clippy::absurd_extreme_comparisons)]
14474 #[allow(unused_comparisons)]
14475 if __tmp.remaining() < Self::ENCODED_LEN {
14476 panic!(
14477 "buffer is too small (need {} bytes, but got {})",
14478 Self::ENCODED_LEN,
14479 __tmp.remaining(),
14480 )
14481 }
14482 __tmp.put_u32_le(self.time_boot_ms);
14483 __tmp.put_i32_le(self.lat);
14484 __tmp.put_i32_le(self.lon);
14485 __tmp.put_i32_le(self.alt);
14486 __tmp.put_i32_le(self.relative_alt);
14487 __tmp.put_i16_le(self.vx);
14488 __tmp.put_i16_le(self.vy);
14489 __tmp.put_i16_le(self.vz);
14490 __tmp.put_u16_le(self.hdg);
14491 if matches!(version, MavlinkVersion::V2) {
14492 let len = __tmp.len();
14493 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14494 } else {
14495 __tmp.len()
14496 }
14497 }
14498}
14499#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
14500#[doc = ""]
14501#[doc = "ID: 63"]
14502#[derive(Debug, Clone, PartialEq)]
14503#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14504#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14505#[cfg_attr(feature = "ts", derive(TS))]
14506#[cfg_attr(feature = "ts", ts(export))]
14507pub struct GLOBAL_POSITION_INT_COV_DATA {
14508 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14509 pub time_usec: u64,
14510 #[doc = "Latitude"]
14511 pub lat: i32,
14512 #[doc = "Longitude"]
14513 pub lon: i32,
14514 #[doc = "Altitude in meters above MSL"]
14515 pub alt: i32,
14516 #[doc = "Altitude above ground"]
14517 pub relative_alt: i32,
14518 #[doc = "Ground X Speed (Latitude)"]
14519 pub vx: f32,
14520 #[doc = "Ground Y Speed (Longitude)"]
14521 pub vy: f32,
14522 #[doc = "Ground Z Speed (Altitude)"]
14523 pub vz: f32,
14524 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
14525 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14526 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14527 pub covariance: [f32; 36],
14528 #[doc = "Class id of the estimator this estimate originated from."]
14529 pub estimator_type: MavEstimatorType,
14530}
14531impl GLOBAL_POSITION_INT_COV_DATA {
14532 pub const ENCODED_LEN: usize = 181usize;
14533 pub const DEFAULT: Self = Self {
14534 time_usec: 0_u64,
14535 lat: 0_i32,
14536 lon: 0_i32,
14537 alt: 0_i32,
14538 relative_alt: 0_i32,
14539 vx: 0.0_f32,
14540 vy: 0.0_f32,
14541 vz: 0.0_f32,
14542 covariance: [0.0_f32; 36usize],
14543 estimator_type: MavEstimatorType::DEFAULT,
14544 };
14545 #[cfg(feature = "arbitrary")]
14546 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14547 use arbitrary::{Arbitrary, Unstructured};
14548 let mut buf = [0u8; 1024];
14549 rng.fill_bytes(&mut buf);
14550 let mut unstructured = Unstructured::new(&buf);
14551 Self::arbitrary(&mut unstructured).unwrap_or_default()
14552 }
14553}
14554impl Default for GLOBAL_POSITION_INT_COV_DATA {
14555 fn default() -> Self {
14556 Self::DEFAULT.clone()
14557 }
14558}
14559impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
14560 type Message = MavMessage;
14561 const ID: u32 = 63u32;
14562 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
14563 const EXTRA_CRC: u8 = 119u8;
14564 const ENCODED_LEN: usize = 181usize;
14565 fn deser(
14566 _version: MavlinkVersion,
14567 __input: &[u8],
14568 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14569 let avail_len = __input.len();
14570 let mut payload_buf = [0; Self::ENCODED_LEN];
14571 let mut buf = if avail_len < Self::ENCODED_LEN {
14572 payload_buf[0..avail_len].copy_from_slice(__input);
14573 Bytes::new(&payload_buf)
14574 } else {
14575 Bytes::new(__input)
14576 };
14577 let mut __struct = Self::default();
14578 __struct.time_usec = buf.get_u64_le();
14579 __struct.lat = buf.get_i32_le();
14580 __struct.lon = buf.get_i32_le();
14581 __struct.alt = buf.get_i32_le();
14582 __struct.relative_alt = buf.get_i32_le();
14583 __struct.vx = buf.get_f32_le();
14584 __struct.vy = buf.get_f32_le();
14585 __struct.vz = buf.get_f32_le();
14586 for v in &mut __struct.covariance {
14587 let val = buf.get_f32_le();
14588 *v = val;
14589 }
14590 let tmp = buf.get_u8();
14591 __struct.estimator_type =
14592 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14593 enum_type: "MavEstimatorType",
14594 value: tmp as u32,
14595 })?;
14596 Ok(__struct)
14597 }
14598 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14599 let mut __tmp = BytesMut::new(bytes);
14600 #[allow(clippy::absurd_extreme_comparisons)]
14601 #[allow(unused_comparisons)]
14602 if __tmp.remaining() < Self::ENCODED_LEN {
14603 panic!(
14604 "buffer is too small (need {} bytes, but got {})",
14605 Self::ENCODED_LEN,
14606 __tmp.remaining(),
14607 )
14608 }
14609 __tmp.put_u64_le(self.time_usec);
14610 __tmp.put_i32_le(self.lat);
14611 __tmp.put_i32_le(self.lon);
14612 __tmp.put_i32_le(self.alt);
14613 __tmp.put_i32_le(self.relative_alt);
14614 __tmp.put_f32_le(self.vx);
14615 __tmp.put_f32_le(self.vy);
14616 __tmp.put_f32_le(self.vz);
14617 for val in &self.covariance {
14618 __tmp.put_f32_le(*val);
14619 }
14620 __tmp.put_u8(self.estimator_type as u8);
14621 if matches!(version, MavlinkVersion::V2) {
14622 let len = __tmp.len();
14623 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14624 } else {
14625 __tmp.len()
14626 }
14627 }
14628}
14629#[doc = "Global position/attitude estimate from a vision source."]
14630#[doc = ""]
14631#[doc = "ID: 101"]
14632#[derive(Debug, Clone, PartialEq)]
14633#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14634#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14635#[cfg_attr(feature = "ts", derive(TS))]
14636#[cfg_attr(feature = "ts", ts(export))]
14637pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14638 #[doc = "Timestamp (UNIX time or since system boot)"]
14639 pub usec: u64,
14640 #[doc = "Global X position"]
14641 pub x: f32,
14642 #[doc = "Global Y position"]
14643 pub y: f32,
14644 #[doc = "Global Z position"]
14645 pub z: f32,
14646 #[doc = "Roll angle"]
14647 pub roll: f32,
14648 #[doc = "Pitch angle"]
14649 pub pitch: f32,
14650 #[doc = "Yaw angle"]
14651 pub yaw: f32,
14652 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
14653 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14654 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14655 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14656 pub covariance: [f32; 21],
14657 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
14658 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14659 pub reset_counter: u8,
14660}
14661impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14662 pub const ENCODED_LEN: usize = 117usize;
14663 pub const DEFAULT: Self = Self {
14664 usec: 0_u64,
14665 x: 0.0_f32,
14666 y: 0.0_f32,
14667 z: 0.0_f32,
14668 roll: 0.0_f32,
14669 pitch: 0.0_f32,
14670 yaw: 0.0_f32,
14671 covariance: [0.0_f32; 21usize],
14672 reset_counter: 0_u8,
14673 };
14674 #[cfg(feature = "arbitrary")]
14675 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14676 use arbitrary::{Arbitrary, Unstructured};
14677 let mut buf = [0u8; 1024];
14678 rng.fill_bytes(&mut buf);
14679 let mut unstructured = Unstructured::new(&buf);
14680 Self::arbitrary(&mut unstructured).unwrap_or_default()
14681 }
14682}
14683impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14684 fn default() -> Self {
14685 Self::DEFAULT.clone()
14686 }
14687}
14688impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14689 type Message = MavMessage;
14690 const ID: u32 = 101u32;
14691 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
14692 const EXTRA_CRC: u8 = 102u8;
14693 const ENCODED_LEN: usize = 117usize;
14694 fn deser(
14695 _version: MavlinkVersion,
14696 __input: &[u8],
14697 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14698 let avail_len = __input.len();
14699 let mut payload_buf = [0; Self::ENCODED_LEN];
14700 let mut buf = if avail_len < Self::ENCODED_LEN {
14701 payload_buf[0..avail_len].copy_from_slice(__input);
14702 Bytes::new(&payload_buf)
14703 } else {
14704 Bytes::new(__input)
14705 };
14706 let mut __struct = Self::default();
14707 __struct.usec = buf.get_u64_le();
14708 __struct.x = buf.get_f32_le();
14709 __struct.y = buf.get_f32_le();
14710 __struct.z = buf.get_f32_le();
14711 __struct.roll = buf.get_f32_le();
14712 __struct.pitch = buf.get_f32_le();
14713 __struct.yaw = buf.get_f32_le();
14714 for v in &mut __struct.covariance {
14715 let val = buf.get_f32_le();
14716 *v = val;
14717 }
14718 __struct.reset_counter = buf.get_u8();
14719 Ok(__struct)
14720 }
14721 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14722 let mut __tmp = BytesMut::new(bytes);
14723 #[allow(clippy::absurd_extreme_comparisons)]
14724 #[allow(unused_comparisons)]
14725 if __tmp.remaining() < Self::ENCODED_LEN {
14726 panic!(
14727 "buffer is too small (need {} bytes, but got {})",
14728 Self::ENCODED_LEN,
14729 __tmp.remaining(),
14730 )
14731 }
14732 __tmp.put_u64_le(self.usec);
14733 __tmp.put_f32_le(self.x);
14734 __tmp.put_f32_le(self.y);
14735 __tmp.put_f32_le(self.z);
14736 __tmp.put_f32_le(self.roll);
14737 __tmp.put_f32_le(self.pitch);
14738 __tmp.put_f32_le(self.yaw);
14739 if matches!(version, MavlinkVersion::V2) {
14740 for val in &self.covariance {
14741 __tmp.put_f32_le(*val);
14742 }
14743 __tmp.put_u8(self.reset_counter);
14744 let len = __tmp.len();
14745 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14746 } else {
14747 __tmp.len()
14748 }
14749 }
14750}
14751#[doc = "Second GPS data."]
14752#[doc = ""]
14753#[doc = "ID: 124"]
14754#[derive(Debug, Clone, PartialEq)]
14755#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14756#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14757#[cfg_attr(feature = "ts", derive(TS))]
14758#[cfg_attr(feature = "ts", ts(export))]
14759pub struct GPS2_RAW_DATA {
14760 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14761 pub time_usec: u64,
14762 #[doc = "Latitude (WGS84)"]
14763 pub lat: i32,
14764 #[doc = "Longitude (WGS84)"]
14765 pub lon: i32,
14766 #[doc = "Altitude (MSL). Positive for up."]
14767 pub alt: i32,
14768 #[doc = "Age of DGPS info"]
14769 pub dgps_age: u32,
14770 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14771 pub eph: u16,
14772 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14773 pub epv: u16,
14774 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14775 pub vel: u16,
14776 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14777 pub cog: u16,
14778 #[doc = "GPS fix type."]
14779 pub fix_type: GpsFixType,
14780 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14781 pub satellites_visible: u8,
14782 #[doc = "Number of DGPS satellites"]
14783 pub dgps_numch: u8,
14784 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14785 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14786 pub yaw: u16,
14787 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14788 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14789 pub alt_ellipsoid: i32,
14790 #[doc = "Position uncertainty."]
14791 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14792 pub h_acc: u32,
14793 #[doc = "Altitude uncertainty."]
14794 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14795 pub v_acc: u32,
14796 #[doc = "Speed uncertainty."]
14797 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14798 pub vel_acc: u32,
14799 #[doc = "Heading / track uncertainty"]
14800 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14801 pub hdg_acc: u32,
14802}
14803impl GPS2_RAW_DATA {
14804 pub const ENCODED_LEN: usize = 57usize;
14805 pub const DEFAULT: Self = Self {
14806 time_usec: 0_u64,
14807 lat: 0_i32,
14808 lon: 0_i32,
14809 alt: 0_i32,
14810 dgps_age: 0_u32,
14811 eph: 0_u16,
14812 epv: 0_u16,
14813 vel: 0_u16,
14814 cog: 0_u16,
14815 fix_type: GpsFixType::DEFAULT,
14816 satellites_visible: 0_u8,
14817 dgps_numch: 0_u8,
14818 yaw: 0_u16,
14819 alt_ellipsoid: 0_i32,
14820 h_acc: 0_u32,
14821 v_acc: 0_u32,
14822 vel_acc: 0_u32,
14823 hdg_acc: 0_u32,
14824 };
14825 #[cfg(feature = "arbitrary")]
14826 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14827 use arbitrary::{Arbitrary, Unstructured};
14828 let mut buf = [0u8; 1024];
14829 rng.fill_bytes(&mut buf);
14830 let mut unstructured = Unstructured::new(&buf);
14831 Self::arbitrary(&mut unstructured).unwrap_or_default()
14832 }
14833}
14834impl Default for GPS2_RAW_DATA {
14835 fn default() -> Self {
14836 Self::DEFAULT.clone()
14837 }
14838}
14839impl MessageData for GPS2_RAW_DATA {
14840 type Message = MavMessage;
14841 const ID: u32 = 124u32;
14842 const NAME: &'static str = "GPS2_RAW";
14843 const EXTRA_CRC: u8 = 87u8;
14844 const ENCODED_LEN: usize = 57usize;
14845 fn deser(
14846 _version: MavlinkVersion,
14847 __input: &[u8],
14848 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14849 let avail_len = __input.len();
14850 let mut payload_buf = [0; Self::ENCODED_LEN];
14851 let mut buf = if avail_len < Self::ENCODED_LEN {
14852 payload_buf[0..avail_len].copy_from_slice(__input);
14853 Bytes::new(&payload_buf)
14854 } else {
14855 Bytes::new(__input)
14856 };
14857 let mut __struct = Self::default();
14858 __struct.time_usec = buf.get_u64_le();
14859 __struct.lat = buf.get_i32_le();
14860 __struct.lon = buf.get_i32_le();
14861 __struct.alt = buf.get_i32_le();
14862 __struct.dgps_age = buf.get_u32_le();
14863 __struct.eph = buf.get_u16_le();
14864 __struct.epv = buf.get_u16_le();
14865 __struct.vel = buf.get_u16_le();
14866 __struct.cog = buf.get_u16_le();
14867 let tmp = buf.get_u8();
14868 __struct.fix_type =
14869 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14870 enum_type: "GpsFixType",
14871 value: tmp as u32,
14872 })?;
14873 __struct.satellites_visible = buf.get_u8();
14874 __struct.dgps_numch = buf.get_u8();
14875 __struct.yaw = buf.get_u16_le();
14876 __struct.alt_ellipsoid = buf.get_i32_le();
14877 __struct.h_acc = buf.get_u32_le();
14878 __struct.v_acc = buf.get_u32_le();
14879 __struct.vel_acc = buf.get_u32_le();
14880 __struct.hdg_acc = buf.get_u32_le();
14881 Ok(__struct)
14882 }
14883 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14884 let mut __tmp = BytesMut::new(bytes);
14885 #[allow(clippy::absurd_extreme_comparisons)]
14886 #[allow(unused_comparisons)]
14887 if __tmp.remaining() < Self::ENCODED_LEN {
14888 panic!(
14889 "buffer is too small (need {} bytes, but got {})",
14890 Self::ENCODED_LEN,
14891 __tmp.remaining(),
14892 )
14893 }
14894 __tmp.put_u64_le(self.time_usec);
14895 __tmp.put_i32_le(self.lat);
14896 __tmp.put_i32_le(self.lon);
14897 __tmp.put_i32_le(self.alt);
14898 __tmp.put_u32_le(self.dgps_age);
14899 __tmp.put_u16_le(self.eph);
14900 __tmp.put_u16_le(self.epv);
14901 __tmp.put_u16_le(self.vel);
14902 __tmp.put_u16_le(self.cog);
14903 __tmp.put_u8(self.fix_type as u8);
14904 __tmp.put_u8(self.satellites_visible);
14905 __tmp.put_u8(self.dgps_numch);
14906 if matches!(version, MavlinkVersion::V2) {
14907 __tmp.put_u16_le(self.yaw);
14908 __tmp.put_i32_le(self.alt_ellipsoid);
14909 __tmp.put_u32_le(self.h_acc);
14910 __tmp.put_u32_le(self.v_acc);
14911 __tmp.put_u32_le(self.vel_acc);
14912 __tmp.put_u32_le(self.hdg_acc);
14913 let len = __tmp.len();
14914 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14915 } else {
14916 __tmp.len()
14917 }
14918 }
14919}
14920#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14921#[doc = ""]
14922#[doc = "ID: 128"]
14923#[derive(Debug, Clone, PartialEq)]
14924#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14925#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14926#[cfg_attr(feature = "ts", derive(TS))]
14927#[cfg_attr(feature = "ts", ts(export))]
14928pub struct GPS2_RTK_DATA {
14929 #[doc = "Time since boot of last baseline message received."]
14930 pub time_last_baseline_ms: u32,
14931 #[doc = "GPS Time of Week of last baseline"]
14932 pub tow: u32,
14933 #[doc = "Current baseline in ECEF x or NED north component."]
14934 pub baseline_a_mm: i32,
14935 #[doc = "Current baseline in ECEF y or NED east component."]
14936 pub baseline_b_mm: i32,
14937 #[doc = "Current baseline in ECEF z or NED down component."]
14938 pub baseline_c_mm: i32,
14939 #[doc = "Current estimate of baseline accuracy."]
14940 pub accuracy: u32,
14941 #[doc = "Current number of integer ambiguity hypotheses."]
14942 pub iar_num_hypotheses: i32,
14943 #[doc = "GPS Week Number of last baseline"]
14944 pub wn: u16,
14945 #[doc = "Identification of connected RTK receiver."]
14946 pub rtk_receiver_id: u8,
14947 #[doc = "GPS-specific health report for RTK data."]
14948 pub rtk_health: u8,
14949 #[doc = "Rate of baseline messages being received by GPS"]
14950 pub rtk_rate: u8,
14951 #[doc = "Current number of sats used for RTK calculation."]
14952 pub nsats: u8,
14953 #[doc = "Coordinate system of baseline"]
14954 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14955}
14956impl GPS2_RTK_DATA {
14957 pub const ENCODED_LEN: usize = 35usize;
14958 pub const DEFAULT: Self = Self {
14959 time_last_baseline_ms: 0_u32,
14960 tow: 0_u32,
14961 baseline_a_mm: 0_i32,
14962 baseline_b_mm: 0_i32,
14963 baseline_c_mm: 0_i32,
14964 accuracy: 0_u32,
14965 iar_num_hypotheses: 0_i32,
14966 wn: 0_u16,
14967 rtk_receiver_id: 0_u8,
14968 rtk_health: 0_u8,
14969 rtk_rate: 0_u8,
14970 nsats: 0_u8,
14971 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14972 };
14973 #[cfg(feature = "arbitrary")]
14974 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14975 use arbitrary::{Arbitrary, Unstructured};
14976 let mut buf = [0u8; 1024];
14977 rng.fill_bytes(&mut buf);
14978 let mut unstructured = Unstructured::new(&buf);
14979 Self::arbitrary(&mut unstructured).unwrap_or_default()
14980 }
14981}
14982impl Default for GPS2_RTK_DATA {
14983 fn default() -> Self {
14984 Self::DEFAULT.clone()
14985 }
14986}
14987impl MessageData for GPS2_RTK_DATA {
14988 type Message = MavMessage;
14989 const ID: u32 = 128u32;
14990 const NAME: &'static str = "GPS2_RTK";
14991 const EXTRA_CRC: u8 = 226u8;
14992 const ENCODED_LEN: usize = 35usize;
14993 fn deser(
14994 _version: MavlinkVersion,
14995 __input: &[u8],
14996 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14997 let avail_len = __input.len();
14998 let mut payload_buf = [0; Self::ENCODED_LEN];
14999 let mut buf = if avail_len < Self::ENCODED_LEN {
15000 payload_buf[0..avail_len].copy_from_slice(__input);
15001 Bytes::new(&payload_buf)
15002 } else {
15003 Bytes::new(__input)
15004 };
15005 let mut __struct = Self::default();
15006 __struct.time_last_baseline_ms = buf.get_u32_le();
15007 __struct.tow = buf.get_u32_le();
15008 __struct.baseline_a_mm = buf.get_i32_le();
15009 __struct.baseline_b_mm = buf.get_i32_le();
15010 __struct.baseline_c_mm = buf.get_i32_le();
15011 __struct.accuracy = buf.get_u32_le();
15012 __struct.iar_num_hypotheses = buf.get_i32_le();
15013 __struct.wn = buf.get_u16_le();
15014 __struct.rtk_receiver_id = buf.get_u8();
15015 __struct.rtk_health = buf.get_u8();
15016 __struct.rtk_rate = buf.get_u8();
15017 __struct.nsats = buf.get_u8();
15018 let tmp = buf.get_u8();
15019 __struct.baseline_coords_type =
15020 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15021 enum_type: "RtkBaselineCoordinateSystem",
15022 value: tmp as u32,
15023 })?;
15024 Ok(__struct)
15025 }
15026 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15027 let mut __tmp = BytesMut::new(bytes);
15028 #[allow(clippy::absurd_extreme_comparisons)]
15029 #[allow(unused_comparisons)]
15030 if __tmp.remaining() < Self::ENCODED_LEN {
15031 panic!(
15032 "buffer is too small (need {} bytes, but got {})",
15033 Self::ENCODED_LEN,
15034 __tmp.remaining(),
15035 )
15036 }
15037 __tmp.put_u32_le(self.time_last_baseline_ms);
15038 __tmp.put_u32_le(self.tow);
15039 __tmp.put_i32_le(self.baseline_a_mm);
15040 __tmp.put_i32_le(self.baseline_b_mm);
15041 __tmp.put_i32_le(self.baseline_c_mm);
15042 __tmp.put_u32_le(self.accuracy);
15043 __tmp.put_i32_le(self.iar_num_hypotheses);
15044 __tmp.put_u16_le(self.wn);
15045 __tmp.put_u8(self.rtk_receiver_id);
15046 __tmp.put_u8(self.rtk_health);
15047 __tmp.put_u8(self.rtk_rate);
15048 __tmp.put_u8(self.nsats);
15049 __tmp.put_u8(self.baseline_coords_type as u8);
15050 if matches!(version, MavlinkVersion::V2) {
15051 let len = __tmp.len();
15052 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15053 } else {
15054 __tmp.len()
15055 }
15056 }
15057}
15058#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
15059#[doc = ""]
15060#[doc = "ID: 49"]
15061#[derive(Debug, Clone, PartialEq)]
15062#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15063#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15064#[cfg_attr(feature = "ts", derive(TS))]
15065#[cfg_attr(feature = "ts", ts(export))]
15066pub struct GPS_GLOBAL_ORIGIN_DATA {
15067 #[doc = "Latitude (WGS84)"]
15068 pub latitude: i32,
15069 #[doc = "Longitude (WGS84)"]
15070 pub longitude: i32,
15071 #[doc = "Altitude (MSL). Positive for up."]
15072 pub altitude: i32,
15073 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15074 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15075 pub time_usec: u64,
15076}
15077impl GPS_GLOBAL_ORIGIN_DATA {
15078 pub const ENCODED_LEN: usize = 20usize;
15079 pub const DEFAULT: Self = Self {
15080 latitude: 0_i32,
15081 longitude: 0_i32,
15082 altitude: 0_i32,
15083 time_usec: 0_u64,
15084 };
15085 #[cfg(feature = "arbitrary")]
15086 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15087 use arbitrary::{Arbitrary, Unstructured};
15088 let mut buf = [0u8; 1024];
15089 rng.fill_bytes(&mut buf);
15090 let mut unstructured = Unstructured::new(&buf);
15091 Self::arbitrary(&mut unstructured).unwrap_or_default()
15092 }
15093}
15094impl Default for GPS_GLOBAL_ORIGIN_DATA {
15095 fn default() -> Self {
15096 Self::DEFAULT.clone()
15097 }
15098}
15099impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
15100 type Message = MavMessage;
15101 const ID: u32 = 49u32;
15102 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
15103 const EXTRA_CRC: u8 = 39u8;
15104 const ENCODED_LEN: usize = 20usize;
15105 fn deser(
15106 _version: MavlinkVersion,
15107 __input: &[u8],
15108 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15109 let avail_len = __input.len();
15110 let mut payload_buf = [0; Self::ENCODED_LEN];
15111 let mut buf = if avail_len < Self::ENCODED_LEN {
15112 payload_buf[0..avail_len].copy_from_slice(__input);
15113 Bytes::new(&payload_buf)
15114 } else {
15115 Bytes::new(__input)
15116 };
15117 let mut __struct = Self::default();
15118 __struct.latitude = buf.get_i32_le();
15119 __struct.longitude = buf.get_i32_le();
15120 __struct.altitude = buf.get_i32_le();
15121 __struct.time_usec = buf.get_u64_le();
15122 Ok(__struct)
15123 }
15124 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15125 let mut __tmp = BytesMut::new(bytes);
15126 #[allow(clippy::absurd_extreme_comparisons)]
15127 #[allow(unused_comparisons)]
15128 if __tmp.remaining() < Self::ENCODED_LEN {
15129 panic!(
15130 "buffer is too small (need {} bytes, but got {})",
15131 Self::ENCODED_LEN,
15132 __tmp.remaining(),
15133 )
15134 }
15135 __tmp.put_i32_le(self.latitude);
15136 __tmp.put_i32_le(self.longitude);
15137 __tmp.put_i32_le(self.altitude);
15138 if matches!(version, MavlinkVersion::V2) {
15139 __tmp.put_u64_le(self.time_usec);
15140 let len = __tmp.len();
15141 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15142 } else {
15143 __tmp.len()
15144 }
15145 }
15146}
15147#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
15148#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
15149#[doc = ""]
15150#[doc = "ID: 123"]
15151#[derive(Debug, Clone, PartialEq)]
15152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15153#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15154#[cfg_attr(feature = "ts", derive(TS))]
15155#[cfg_attr(feature = "ts", ts(export))]
15156pub struct GPS_INJECT_DATA_DATA {
15157 #[doc = "System ID"]
15158 pub target_system: u8,
15159 #[doc = "Component ID"]
15160 pub target_component: u8,
15161 #[doc = "Data length"]
15162 pub len: u8,
15163 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
15164 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15165 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15166 pub data: [u8; 110],
15167}
15168impl GPS_INJECT_DATA_DATA {
15169 pub const ENCODED_LEN: usize = 113usize;
15170 pub const DEFAULT: Self = Self {
15171 target_system: 0_u8,
15172 target_component: 0_u8,
15173 len: 0_u8,
15174 data: [0_u8; 110usize],
15175 };
15176 #[cfg(feature = "arbitrary")]
15177 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15178 use arbitrary::{Arbitrary, Unstructured};
15179 let mut buf = [0u8; 1024];
15180 rng.fill_bytes(&mut buf);
15181 let mut unstructured = Unstructured::new(&buf);
15182 Self::arbitrary(&mut unstructured).unwrap_or_default()
15183 }
15184}
15185impl Default for GPS_INJECT_DATA_DATA {
15186 fn default() -> Self {
15187 Self::DEFAULT.clone()
15188 }
15189}
15190impl MessageData for GPS_INJECT_DATA_DATA {
15191 type Message = MavMessage;
15192 const ID: u32 = 123u32;
15193 const NAME: &'static str = "GPS_INJECT_DATA";
15194 const EXTRA_CRC: u8 = 250u8;
15195 const ENCODED_LEN: usize = 113usize;
15196 fn deser(
15197 _version: MavlinkVersion,
15198 __input: &[u8],
15199 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15200 let avail_len = __input.len();
15201 let mut payload_buf = [0; Self::ENCODED_LEN];
15202 let mut buf = if avail_len < Self::ENCODED_LEN {
15203 payload_buf[0..avail_len].copy_from_slice(__input);
15204 Bytes::new(&payload_buf)
15205 } else {
15206 Bytes::new(__input)
15207 };
15208 let mut __struct = Self::default();
15209 __struct.target_system = buf.get_u8();
15210 __struct.target_component = buf.get_u8();
15211 __struct.len = buf.get_u8();
15212 for v in &mut __struct.data {
15213 let val = buf.get_u8();
15214 *v = val;
15215 }
15216 Ok(__struct)
15217 }
15218 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15219 let mut __tmp = BytesMut::new(bytes);
15220 #[allow(clippy::absurd_extreme_comparisons)]
15221 #[allow(unused_comparisons)]
15222 if __tmp.remaining() < Self::ENCODED_LEN {
15223 panic!(
15224 "buffer is too small (need {} bytes, but got {})",
15225 Self::ENCODED_LEN,
15226 __tmp.remaining(),
15227 )
15228 }
15229 __tmp.put_u8(self.target_system);
15230 __tmp.put_u8(self.target_component);
15231 __tmp.put_u8(self.len);
15232 for val in &self.data {
15233 __tmp.put_u8(*val);
15234 }
15235 if matches!(version, MavlinkVersion::V2) {
15236 let len = __tmp.len();
15237 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15238 } else {
15239 __tmp.len()
15240 }
15241 }
15242}
15243#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
15244#[doc = ""]
15245#[doc = "ID: 232"]
15246#[derive(Debug, Clone, PartialEq)]
15247#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15248#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15249#[cfg_attr(feature = "ts", derive(TS))]
15250#[cfg_attr(feature = "ts", ts(export))]
15251pub struct GPS_INPUT_DATA {
15252 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15253 pub time_usec: u64,
15254 #[doc = "GPS time (from start of GPS week)"]
15255 pub time_week_ms: u32,
15256 #[doc = "Latitude (WGS84)"]
15257 pub lat: i32,
15258 #[doc = "Longitude (WGS84)"]
15259 pub lon: i32,
15260 #[doc = "Altitude (MSL). Positive for up."]
15261 pub alt: f32,
15262 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
15263 pub hdop: f32,
15264 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
15265 pub vdop: f32,
15266 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15267 pub vn: f32,
15268 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15269 pub ve: f32,
15270 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15271 pub vd: f32,
15272 #[doc = "GPS speed accuracy"]
15273 pub speed_accuracy: f32,
15274 #[doc = "GPS horizontal accuracy"]
15275 pub horiz_accuracy: f32,
15276 #[doc = "GPS vertical accuracy"]
15277 pub vert_accuracy: f32,
15278 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
15279 pub ignore_flags: GpsInputIgnoreFlags,
15280 #[doc = "GPS week number"]
15281 pub time_week: u16,
15282 #[doc = "ID of the GPS for multiple GPS inputs"]
15283 pub gps_id: u8,
15284 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
15285 pub fix_type: u8,
15286 #[doc = "Number of satellites visible."]
15287 pub satellites_visible: u8,
15288 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15289 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15290 pub yaw: u16,
15291}
15292impl GPS_INPUT_DATA {
15293 pub const ENCODED_LEN: usize = 65usize;
15294 pub const DEFAULT: Self = Self {
15295 time_usec: 0_u64,
15296 time_week_ms: 0_u32,
15297 lat: 0_i32,
15298 lon: 0_i32,
15299 alt: 0.0_f32,
15300 hdop: 0.0_f32,
15301 vdop: 0.0_f32,
15302 vn: 0.0_f32,
15303 ve: 0.0_f32,
15304 vd: 0.0_f32,
15305 speed_accuracy: 0.0_f32,
15306 horiz_accuracy: 0.0_f32,
15307 vert_accuracy: 0.0_f32,
15308 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
15309 time_week: 0_u16,
15310 gps_id: 0_u8,
15311 fix_type: 0_u8,
15312 satellites_visible: 0_u8,
15313 yaw: 0_u16,
15314 };
15315 #[cfg(feature = "arbitrary")]
15316 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15317 use arbitrary::{Arbitrary, Unstructured};
15318 let mut buf = [0u8; 1024];
15319 rng.fill_bytes(&mut buf);
15320 let mut unstructured = Unstructured::new(&buf);
15321 Self::arbitrary(&mut unstructured).unwrap_or_default()
15322 }
15323}
15324impl Default for GPS_INPUT_DATA {
15325 fn default() -> Self {
15326 Self::DEFAULT.clone()
15327 }
15328}
15329impl MessageData for GPS_INPUT_DATA {
15330 type Message = MavMessage;
15331 const ID: u32 = 232u32;
15332 const NAME: &'static str = "GPS_INPUT";
15333 const EXTRA_CRC: u8 = 151u8;
15334 const ENCODED_LEN: usize = 65usize;
15335 fn deser(
15336 _version: MavlinkVersion,
15337 __input: &[u8],
15338 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15339 let avail_len = __input.len();
15340 let mut payload_buf = [0; Self::ENCODED_LEN];
15341 let mut buf = if avail_len < Self::ENCODED_LEN {
15342 payload_buf[0..avail_len].copy_from_slice(__input);
15343 Bytes::new(&payload_buf)
15344 } else {
15345 Bytes::new(__input)
15346 };
15347 let mut __struct = Self::default();
15348 __struct.time_usec = buf.get_u64_le();
15349 __struct.time_week_ms = buf.get_u32_le();
15350 __struct.lat = buf.get_i32_le();
15351 __struct.lon = buf.get_i32_le();
15352 __struct.alt = buf.get_f32_le();
15353 __struct.hdop = buf.get_f32_le();
15354 __struct.vdop = buf.get_f32_le();
15355 __struct.vn = buf.get_f32_le();
15356 __struct.ve = buf.get_f32_le();
15357 __struct.vd = buf.get_f32_le();
15358 __struct.speed_accuracy = buf.get_f32_le();
15359 __struct.horiz_accuracy = buf.get_f32_le();
15360 __struct.vert_accuracy = buf.get_f32_le();
15361 let tmp = buf.get_u16_le();
15362 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
15363 tmp & GpsInputIgnoreFlags::all().bits(),
15364 )
15365 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15366 flag_type: "GpsInputIgnoreFlags",
15367 value: tmp as u32,
15368 })?;
15369 __struct.time_week = buf.get_u16_le();
15370 __struct.gps_id = buf.get_u8();
15371 __struct.fix_type = buf.get_u8();
15372 __struct.satellites_visible = buf.get_u8();
15373 __struct.yaw = buf.get_u16_le();
15374 Ok(__struct)
15375 }
15376 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15377 let mut __tmp = BytesMut::new(bytes);
15378 #[allow(clippy::absurd_extreme_comparisons)]
15379 #[allow(unused_comparisons)]
15380 if __tmp.remaining() < Self::ENCODED_LEN {
15381 panic!(
15382 "buffer is too small (need {} bytes, but got {})",
15383 Self::ENCODED_LEN,
15384 __tmp.remaining(),
15385 )
15386 }
15387 __tmp.put_u64_le(self.time_usec);
15388 __tmp.put_u32_le(self.time_week_ms);
15389 __tmp.put_i32_le(self.lat);
15390 __tmp.put_i32_le(self.lon);
15391 __tmp.put_f32_le(self.alt);
15392 __tmp.put_f32_le(self.hdop);
15393 __tmp.put_f32_le(self.vdop);
15394 __tmp.put_f32_le(self.vn);
15395 __tmp.put_f32_le(self.ve);
15396 __tmp.put_f32_le(self.vd);
15397 __tmp.put_f32_le(self.speed_accuracy);
15398 __tmp.put_f32_le(self.horiz_accuracy);
15399 __tmp.put_f32_le(self.vert_accuracy);
15400 __tmp.put_u16_le(self.ignore_flags.bits());
15401 __tmp.put_u16_le(self.time_week);
15402 __tmp.put_u8(self.gps_id);
15403 __tmp.put_u8(self.fix_type);
15404 __tmp.put_u8(self.satellites_visible);
15405 if matches!(version, MavlinkVersion::V2) {
15406 __tmp.put_u16_le(self.yaw);
15407 let len = __tmp.len();
15408 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15409 } else {
15410 __tmp.len()
15411 }
15412 }
15413}
15414#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15415#[doc = ""]
15416#[doc = "ID: 24"]
15417#[derive(Debug, Clone, PartialEq)]
15418#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15419#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15420#[cfg_attr(feature = "ts", derive(TS))]
15421#[cfg_attr(feature = "ts", ts(export))]
15422pub struct GPS_RAW_INT_DATA {
15423 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15424 pub time_usec: u64,
15425 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
15426 pub lat: i32,
15427 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
15428 pub lon: i32,
15429 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
15430 pub alt: i32,
15431 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15432 pub eph: u16,
15433 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15434 pub epv: u16,
15435 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15436 pub vel: u16,
15437 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15438 pub cog: u16,
15439 #[doc = "GPS fix type."]
15440 pub fix_type: GpsFixType,
15441 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15442 pub satellites_visible: u8,
15443 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
15444 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15445 pub alt_ellipsoid: i32,
15446 #[doc = "Position uncertainty."]
15447 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15448 pub h_acc: u32,
15449 #[doc = "Altitude uncertainty."]
15450 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15451 pub v_acc: u32,
15452 #[doc = "Speed uncertainty."]
15453 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15454 pub vel_acc: u32,
15455 #[doc = "Heading / track uncertainty"]
15456 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15457 pub hdg_acc: u32,
15458 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
15459 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15460 pub yaw: u16,
15461}
15462impl GPS_RAW_INT_DATA {
15463 pub const ENCODED_LEN: usize = 52usize;
15464 pub const DEFAULT: Self = Self {
15465 time_usec: 0_u64,
15466 lat: 0_i32,
15467 lon: 0_i32,
15468 alt: 0_i32,
15469 eph: 0_u16,
15470 epv: 0_u16,
15471 vel: 0_u16,
15472 cog: 0_u16,
15473 fix_type: GpsFixType::DEFAULT,
15474 satellites_visible: 0_u8,
15475 alt_ellipsoid: 0_i32,
15476 h_acc: 0_u32,
15477 v_acc: 0_u32,
15478 vel_acc: 0_u32,
15479 hdg_acc: 0_u32,
15480 yaw: 0_u16,
15481 };
15482 #[cfg(feature = "arbitrary")]
15483 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15484 use arbitrary::{Arbitrary, Unstructured};
15485 let mut buf = [0u8; 1024];
15486 rng.fill_bytes(&mut buf);
15487 let mut unstructured = Unstructured::new(&buf);
15488 Self::arbitrary(&mut unstructured).unwrap_or_default()
15489 }
15490}
15491impl Default for GPS_RAW_INT_DATA {
15492 fn default() -> Self {
15493 Self::DEFAULT.clone()
15494 }
15495}
15496impl MessageData for GPS_RAW_INT_DATA {
15497 type Message = MavMessage;
15498 const ID: u32 = 24u32;
15499 const NAME: &'static str = "GPS_RAW_INT";
15500 const EXTRA_CRC: u8 = 24u8;
15501 const ENCODED_LEN: usize = 52usize;
15502 fn deser(
15503 _version: MavlinkVersion,
15504 __input: &[u8],
15505 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15506 let avail_len = __input.len();
15507 let mut payload_buf = [0; Self::ENCODED_LEN];
15508 let mut buf = if avail_len < Self::ENCODED_LEN {
15509 payload_buf[0..avail_len].copy_from_slice(__input);
15510 Bytes::new(&payload_buf)
15511 } else {
15512 Bytes::new(__input)
15513 };
15514 let mut __struct = Self::default();
15515 __struct.time_usec = buf.get_u64_le();
15516 __struct.lat = buf.get_i32_le();
15517 __struct.lon = buf.get_i32_le();
15518 __struct.alt = buf.get_i32_le();
15519 __struct.eph = buf.get_u16_le();
15520 __struct.epv = buf.get_u16_le();
15521 __struct.vel = buf.get_u16_le();
15522 __struct.cog = buf.get_u16_le();
15523 let tmp = buf.get_u8();
15524 __struct.fix_type =
15525 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15526 enum_type: "GpsFixType",
15527 value: tmp as u32,
15528 })?;
15529 __struct.satellites_visible = buf.get_u8();
15530 __struct.alt_ellipsoid = buf.get_i32_le();
15531 __struct.h_acc = buf.get_u32_le();
15532 __struct.v_acc = buf.get_u32_le();
15533 __struct.vel_acc = buf.get_u32_le();
15534 __struct.hdg_acc = buf.get_u32_le();
15535 __struct.yaw = buf.get_u16_le();
15536 Ok(__struct)
15537 }
15538 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15539 let mut __tmp = BytesMut::new(bytes);
15540 #[allow(clippy::absurd_extreme_comparisons)]
15541 #[allow(unused_comparisons)]
15542 if __tmp.remaining() < Self::ENCODED_LEN {
15543 panic!(
15544 "buffer is too small (need {} bytes, but got {})",
15545 Self::ENCODED_LEN,
15546 __tmp.remaining(),
15547 )
15548 }
15549 __tmp.put_u64_le(self.time_usec);
15550 __tmp.put_i32_le(self.lat);
15551 __tmp.put_i32_le(self.lon);
15552 __tmp.put_i32_le(self.alt);
15553 __tmp.put_u16_le(self.eph);
15554 __tmp.put_u16_le(self.epv);
15555 __tmp.put_u16_le(self.vel);
15556 __tmp.put_u16_le(self.cog);
15557 __tmp.put_u8(self.fix_type as u8);
15558 __tmp.put_u8(self.satellites_visible);
15559 if matches!(version, MavlinkVersion::V2) {
15560 __tmp.put_i32_le(self.alt_ellipsoid);
15561 __tmp.put_u32_le(self.h_acc);
15562 __tmp.put_u32_le(self.v_acc);
15563 __tmp.put_u32_le(self.vel_acc);
15564 __tmp.put_u32_le(self.hdg_acc);
15565 __tmp.put_u16_le(self.yaw);
15566 let len = __tmp.len();
15567 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15568 } else {
15569 __tmp.len()
15570 }
15571 }
15572}
15573#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
15574#[doc = ""]
15575#[doc = "ID: 233"]
15576#[derive(Debug, Clone, PartialEq)]
15577#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15578#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15579#[cfg_attr(feature = "ts", derive(TS))]
15580#[cfg_attr(feature = "ts", ts(export))]
15581pub struct GPS_RTCM_DATA_DATA {
15582 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
15583 pub flags: u8,
15584 #[doc = "data length"]
15585 pub len: u8,
15586 #[doc = "RTCM message (may be fragmented)"]
15587 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15588 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15589 pub data: [u8; 180],
15590}
15591impl GPS_RTCM_DATA_DATA {
15592 pub const ENCODED_LEN: usize = 182usize;
15593 pub const DEFAULT: Self = Self {
15594 flags: 0_u8,
15595 len: 0_u8,
15596 data: [0_u8; 180usize],
15597 };
15598 #[cfg(feature = "arbitrary")]
15599 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15600 use arbitrary::{Arbitrary, Unstructured};
15601 let mut buf = [0u8; 1024];
15602 rng.fill_bytes(&mut buf);
15603 let mut unstructured = Unstructured::new(&buf);
15604 Self::arbitrary(&mut unstructured).unwrap_or_default()
15605 }
15606}
15607impl Default for GPS_RTCM_DATA_DATA {
15608 fn default() -> Self {
15609 Self::DEFAULT.clone()
15610 }
15611}
15612impl MessageData for GPS_RTCM_DATA_DATA {
15613 type Message = MavMessage;
15614 const ID: u32 = 233u32;
15615 const NAME: &'static str = "GPS_RTCM_DATA";
15616 const EXTRA_CRC: u8 = 35u8;
15617 const ENCODED_LEN: usize = 182usize;
15618 fn deser(
15619 _version: MavlinkVersion,
15620 __input: &[u8],
15621 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15622 let avail_len = __input.len();
15623 let mut payload_buf = [0; Self::ENCODED_LEN];
15624 let mut buf = if avail_len < Self::ENCODED_LEN {
15625 payload_buf[0..avail_len].copy_from_slice(__input);
15626 Bytes::new(&payload_buf)
15627 } else {
15628 Bytes::new(__input)
15629 };
15630 let mut __struct = Self::default();
15631 __struct.flags = buf.get_u8();
15632 __struct.len = buf.get_u8();
15633 for v in &mut __struct.data {
15634 let val = buf.get_u8();
15635 *v = val;
15636 }
15637 Ok(__struct)
15638 }
15639 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15640 let mut __tmp = BytesMut::new(bytes);
15641 #[allow(clippy::absurd_extreme_comparisons)]
15642 #[allow(unused_comparisons)]
15643 if __tmp.remaining() < Self::ENCODED_LEN {
15644 panic!(
15645 "buffer is too small (need {} bytes, but got {})",
15646 Self::ENCODED_LEN,
15647 __tmp.remaining(),
15648 )
15649 }
15650 __tmp.put_u8(self.flags);
15651 __tmp.put_u8(self.len);
15652 for val in &self.data {
15653 __tmp.put_u8(*val);
15654 }
15655 if matches!(version, MavlinkVersion::V2) {
15656 let len = __tmp.len();
15657 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15658 } else {
15659 __tmp.len()
15660 }
15661 }
15662}
15663#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
15664#[doc = ""]
15665#[doc = "ID: 127"]
15666#[derive(Debug, Clone, PartialEq)]
15667#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15668#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15669#[cfg_attr(feature = "ts", derive(TS))]
15670#[cfg_attr(feature = "ts", ts(export))]
15671pub struct GPS_RTK_DATA {
15672 #[doc = "Time since boot of last baseline message received."]
15673 pub time_last_baseline_ms: u32,
15674 #[doc = "GPS Time of Week of last baseline"]
15675 pub tow: u32,
15676 #[doc = "Current baseline in ECEF x or NED north component."]
15677 pub baseline_a_mm: i32,
15678 #[doc = "Current baseline in ECEF y or NED east component."]
15679 pub baseline_b_mm: i32,
15680 #[doc = "Current baseline in ECEF z or NED down component."]
15681 pub baseline_c_mm: i32,
15682 #[doc = "Current estimate of baseline accuracy."]
15683 pub accuracy: u32,
15684 #[doc = "Current number of integer ambiguity hypotheses."]
15685 pub iar_num_hypotheses: i32,
15686 #[doc = "GPS Week Number of last baseline"]
15687 pub wn: u16,
15688 #[doc = "Identification of connected RTK receiver."]
15689 pub rtk_receiver_id: u8,
15690 #[doc = "GPS-specific health report for RTK data."]
15691 pub rtk_health: u8,
15692 #[doc = "Rate of baseline messages being received by GPS"]
15693 pub rtk_rate: u8,
15694 #[doc = "Current number of sats used for RTK calculation."]
15695 pub nsats: u8,
15696 #[doc = "Coordinate system of baseline"]
15697 pub baseline_coords_type: RtkBaselineCoordinateSystem,
15698}
15699impl GPS_RTK_DATA {
15700 pub const ENCODED_LEN: usize = 35usize;
15701 pub const DEFAULT: Self = Self {
15702 time_last_baseline_ms: 0_u32,
15703 tow: 0_u32,
15704 baseline_a_mm: 0_i32,
15705 baseline_b_mm: 0_i32,
15706 baseline_c_mm: 0_i32,
15707 accuracy: 0_u32,
15708 iar_num_hypotheses: 0_i32,
15709 wn: 0_u16,
15710 rtk_receiver_id: 0_u8,
15711 rtk_health: 0_u8,
15712 rtk_rate: 0_u8,
15713 nsats: 0_u8,
15714 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
15715 };
15716 #[cfg(feature = "arbitrary")]
15717 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15718 use arbitrary::{Arbitrary, Unstructured};
15719 let mut buf = [0u8; 1024];
15720 rng.fill_bytes(&mut buf);
15721 let mut unstructured = Unstructured::new(&buf);
15722 Self::arbitrary(&mut unstructured).unwrap_or_default()
15723 }
15724}
15725impl Default for GPS_RTK_DATA {
15726 fn default() -> Self {
15727 Self::DEFAULT.clone()
15728 }
15729}
15730impl MessageData for GPS_RTK_DATA {
15731 type Message = MavMessage;
15732 const ID: u32 = 127u32;
15733 const NAME: &'static str = "GPS_RTK";
15734 const EXTRA_CRC: u8 = 25u8;
15735 const ENCODED_LEN: usize = 35usize;
15736 fn deser(
15737 _version: MavlinkVersion,
15738 __input: &[u8],
15739 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15740 let avail_len = __input.len();
15741 let mut payload_buf = [0; Self::ENCODED_LEN];
15742 let mut buf = if avail_len < Self::ENCODED_LEN {
15743 payload_buf[0..avail_len].copy_from_slice(__input);
15744 Bytes::new(&payload_buf)
15745 } else {
15746 Bytes::new(__input)
15747 };
15748 let mut __struct = Self::default();
15749 __struct.time_last_baseline_ms = buf.get_u32_le();
15750 __struct.tow = buf.get_u32_le();
15751 __struct.baseline_a_mm = buf.get_i32_le();
15752 __struct.baseline_b_mm = buf.get_i32_le();
15753 __struct.baseline_c_mm = buf.get_i32_le();
15754 __struct.accuracy = buf.get_u32_le();
15755 __struct.iar_num_hypotheses = buf.get_i32_le();
15756 __struct.wn = buf.get_u16_le();
15757 __struct.rtk_receiver_id = buf.get_u8();
15758 __struct.rtk_health = buf.get_u8();
15759 __struct.rtk_rate = buf.get_u8();
15760 __struct.nsats = buf.get_u8();
15761 let tmp = buf.get_u8();
15762 __struct.baseline_coords_type =
15763 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15764 enum_type: "RtkBaselineCoordinateSystem",
15765 value: tmp as u32,
15766 })?;
15767 Ok(__struct)
15768 }
15769 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15770 let mut __tmp = BytesMut::new(bytes);
15771 #[allow(clippy::absurd_extreme_comparisons)]
15772 #[allow(unused_comparisons)]
15773 if __tmp.remaining() < Self::ENCODED_LEN {
15774 panic!(
15775 "buffer is too small (need {} bytes, but got {})",
15776 Self::ENCODED_LEN,
15777 __tmp.remaining(),
15778 )
15779 }
15780 __tmp.put_u32_le(self.time_last_baseline_ms);
15781 __tmp.put_u32_le(self.tow);
15782 __tmp.put_i32_le(self.baseline_a_mm);
15783 __tmp.put_i32_le(self.baseline_b_mm);
15784 __tmp.put_i32_le(self.baseline_c_mm);
15785 __tmp.put_u32_le(self.accuracy);
15786 __tmp.put_i32_le(self.iar_num_hypotheses);
15787 __tmp.put_u16_le(self.wn);
15788 __tmp.put_u8(self.rtk_receiver_id);
15789 __tmp.put_u8(self.rtk_health);
15790 __tmp.put_u8(self.rtk_rate);
15791 __tmp.put_u8(self.nsats);
15792 __tmp.put_u8(self.baseline_coords_type as u8);
15793 if matches!(version, MavlinkVersion::V2) {
15794 let len = __tmp.len();
15795 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15796 } else {
15797 __tmp.len()
15798 }
15799 }
15800}
15801#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
15802#[doc = ""]
15803#[doc = "ID: 25"]
15804#[derive(Debug, Clone, PartialEq)]
15805#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15806#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15807#[cfg_attr(feature = "ts", derive(TS))]
15808#[cfg_attr(feature = "ts", ts(export))]
15809pub struct GPS_STATUS_DATA {
15810 #[doc = "Number of satellites visible"]
15811 pub satellites_visible: u8,
15812 #[doc = "Global satellite ID"]
15813 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15814 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15815 pub satellite_prn: [u8; 20],
15816 #[doc = "0: Satellite not used, 1: used for localization"]
15817 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15818 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15819 pub satellite_used: [u8; 20],
15820 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
15821 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15822 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15823 pub satellite_elevation: [u8; 20],
15824 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
15825 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15826 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15827 pub satellite_azimuth: [u8; 20],
15828 #[doc = "Signal to noise ratio of satellite"]
15829 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15830 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15831 pub satellite_snr: [u8; 20],
15832}
15833impl GPS_STATUS_DATA {
15834 pub const ENCODED_LEN: usize = 101usize;
15835 pub const DEFAULT: Self = Self {
15836 satellites_visible: 0_u8,
15837 satellite_prn: [0_u8; 20usize],
15838 satellite_used: [0_u8; 20usize],
15839 satellite_elevation: [0_u8; 20usize],
15840 satellite_azimuth: [0_u8; 20usize],
15841 satellite_snr: [0_u8; 20usize],
15842 };
15843 #[cfg(feature = "arbitrary")]
15844 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15845 use arbitrary::{Arbitrary, Unstructured};
15846 let mut buf = [0u8; 1024];
15847 rng.fill_bytes(&mut buf);
15848 let mut unstructured = Unstructured::new(&buf);
15849 Self::arbitrary(&mut unstructured).unwrap_or_default()
15850 }
15851}
15852impl Default for GPS_STATUS_DATA {
15853 fn default() -> Self {
15854 Self::DEFAULT.clone()
15855 }
15856}
15857impl MessageData for GPS_STATUS_DATA {
15858 type Message = MavMessage;
15859 const ID: u32 = 25u32;
15860 const NAME: &'static str = "GPS_STATUS";
15861 const EXTRA_CRC: u8 = 23u8;
15862 const ENCODED_LEN: usize = 101usize;
15863 fn deser(
15864 _version: MavlinkVersion,
15865 __input: &[u8],
15866 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15867 let avail_len = __input.len();
15868 let mut payload_buf = [0; Self::ENCODED_LEN];
15869 let mut buf = if avail_len < Self::ENCODED_LEN {
15870 payload_buf[0..avail_len].copy_from_slice(__input);
15871 Bytes::new(&payload_buf)
15872 } else {
15873 Bytes::new(__input)
15874 };
15875 let mut __struct = Self::default();
15876 __struct.satellites_visible = buf.get_u8();
15877 for v in &mut __struct.satellite_prn {
15878 let val = buf.get_u8();
15879 *v = val;
15880 }
15881 for v in &mut __struct.satellite_used {
15882 let val = buf.get_u8();
15883 *v = val;
15884 }
15885 for v in &mut __struct.satellite_elevation {
15886 let val = buf.get_u8();
15887 *v = val;
15888 }
15889 for v in &mut __struct.satellite_azimuth {
15890 let val = buf.get_u8();
15891 *v = val;
15892 }
15893 for v in &mut __struct.satellite_snr {
15894 let val = buf.get_u8();
15895 *v = val;
15896 }
15897 Ok(__struct)
15898 }
15899 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15900 let mut __tmp = BytesMut::new(bytes);
15901 #[allow(clippy::absurd_extreme_comparisons)]
15902 #[allow(unused_comparisons)]
15903 if __tmp.remaining() < Self::ENCODED_LEN {
15904 panic!(
15905 "buffer is too small (need {} bytes, but got {})",
15906 Self::ENCODED_LEN,
15907 __tmp.remaining(),
15908 )
15909 }
15910 __tmp.put_u8(self.satellites_visible);
15911 for val in &self.satellite_prn {
15912 __tmp.put_u8(*val);
15913 }
15914 for val in &self.satellite_used {
15915 __tmp.put_u8(*val);
15916 }
15917 for val in &self.satellite_elevation {
15918 __tmp.put_u8(*val);
15919 }
15920 for val in &self.satellite_azimuth {
15921 __tmp.put_u8(*val);
15922 }
15923 for val in &self.satellite_snr {
15924 __tmp.put_u8(*val);
15925 }
15926 if matches!(version, MavlinkVersion::V2) {
15927 let len = __tmp.len();
15928 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15929 } else {
15930 __tmp.len()
15931 }
15932 }
15933}
15934#[doc = "Status of GSM modem (connected to onboard computer)."]
15935#[doc = ""]
15936#[doc = "ID: 8014"]
15937#[derive(Debug, Clone, PartialEq)]
15938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15940#[cfg_attr(feature = "ts", derive(TS))]
15941#[cfg_attr(feature = "ts", ts(export))]
15942pub struct GSM_LINK_STATUS_DATA {
15943 #[doc = "Timestamp (of OBC)"]
15944 pub timestamp: u64,
15945 #[doc = "GSM modem used"]
15946 pub gsm_modem_type: GsmModemType,
15947 #[doc = "GSM link type"]
15948 pub gsm_link_type: GsmLinkType,
15949 #[doc = "RSSI as reported by modem (unconverted)"]
15950 pub rssi: u8,
15951 #[doc = "RSRP (LTE) or RSCP (WCDMA) as reported by modem (unconverted)"]
15952 pub rsrp_rscp: u8,
15953 #[doc = "SINR (LTE) or ECIO (WCDMA) as reported by modem (unconverted)"]
15954 pub sinr_ecio: u8,
15955 #[doc = "RSRQ (LTE only) as reported by modem (unconverted)"]
15956 pub rsrq: u8,
15957}
15958impl GSM_LINK_STATUS_DATA {
15959 pub const ENCODED_LEN: usize = 14usize;
15960 pub const DEFAULT: Self = Self {
15961 timestamp: 0_u64,
15962 gsm_modem_type: GsmModemType::DEFAULT,
15963 gsm_link_type: GsmLinkType::DEFAULT,
15964 rssi: 0_u8,
15965 rsrp_rscp: 0_u8,
15966 sinr_ecio: 0_u8,
15967 rsrq: 0_u8,
15968 };
15969 #[cfg(feature = "arbitrary")]
15970 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15971 use arbitrary::{Arbitrary, Unstructured};
15972 let mut buf = [0u8; 1024];
15973 rng.fill_bytes(&mut buf);
15974 let mut unstructured = Unstructured::new(&buf);
15975 Self::arbitrary(&mut unstructured).unwrap_or_default()
15976 }
15977}
15978impl Default for GSM_LINK_STATUS_DATA {
15979 fn default() -> Self {
15980 Self::DEFAULT.clone()
15981 }
15982}
15983impl MessageData for GSM_LINK_STATUS_DATA {
15984 type Message = MavMessage;
15985 const ID: u32 = 8014u32;
15986 const NAME: &'static str = "GSM_LINK_STATUS";
15987 const EXTRA_CRC: u8 = 200u8;
15988 const ENCODED_LEN: usize = 14usize;
15989 fn deser(
15990 _version: MavlinkVersion,
15991 __input: &[u8],
15992 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15993 let avail_len = __input.len();
15994 let mut payload_buf = [0; Self::ENCODED_LEN];
15995 let mut buf = if avail_len < Self::ENCODED_LEN {
15996 payload_buf[0..avail_len].copy_from_slice(__input);
15997 Bytes::new(&payload_buf)
15998 } else {
15999 Bytes::new(__input)
16000 };
16001 let mut __struct = Self::default();
16002 __struct.timestamp = buf.get_u64_le();
16003 let tmp = buf.get_u8();
16004 __struct.gsm_modem_type =
16005 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16006 enum_type: "GsmModemType",
16007 value: tmp as u32,
16008 })?;
16009 let tmp = buf.get_u8();
16010 __struct.gsm_link_type =
16011 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16012 enum_type: "GsmLinkType",
16013 value: tmp as u32,
16014 })?;
16015 __struct.rssi = buf.get_u8();
16016 __struct.rsrp_rscp = buf.get_u8();
16017 __struct.sinr_ecio = buf.get_u8();
16018 __struct.rsrq = buf.get_u8();
16019 Ok(__struct)
16020 }
16021 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16022 let mut __tmp = BytesMut::new(bytes);
16023 #[allow(clippy::absurd_extreme_comparisons)]
16024 #[allow(unused_comparisons)]
16025 if __tmp.remaining() < Self::ENCODED_LEN {
16026 panic!(
16027 "buffer is too small (need {} bytes, but got {})",
16028 Self::ENCODED_LEN,
16029 __tmp.remaining(),
16030 )
16031 }
16032 __tmp.put_u64_le(self.timestamp);
16033 __tmp.put_u8(self.gsm_modem_type as u8);
16034 __tmp.put_u8(self.gsm_link_type as u8);
16035 __tmp.put_u8(self.rssi);
16036 __tmp.put_u8(self.rsrp_rscp);
16037 __tmp.put_u8(self.sinr_ecio);
16038 __tmp.put_u8(self.rsrq);
16039 if matches!(version, MavlinkVersion::V2) {
16040 let len = __tmp.len();
16041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16042 } else {
16043 __tmp.len()
16044 }
16045 }
16046}
16047#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
16048#[doc = ""]
16049#[doc = "ID: 0"]
16050#[derive(Debug, Clone, PartialEq)]
16051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16052#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16053#[cfg_attr(feature = "ts", derive(TS))]
16054#[cfg_attr(feature = "ts", ts(export))]
16055pub struct HEARTBEAT_DATA {
16056 #[doc = "A bitfield for use for autopilot-specific flags"]
16057 pub custom_mode: u32,
16058 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
16059 pub mavtype: MavType,
16060 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
16061 pub autopilot: MavAutopilot,
16062 #[doc = "System mode bitmap."]
16063 pub base_mode: MavModeFlag,
16064 #[doc = "System status flag."]
16065 pub system_status: MavState,
16066 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
16067 pub mavlink_version: u8,
16068}
16069impl HEARTBEAT_DATA {
16070 pub const ENCODED_LEN: usize = 9usize;
16071 pub const DEFAULT: Self = Self {
16072 custom_mode: 0_u32,
16073 mavtype: MavType::DEFAULT,
16074 autopilot: MavAutopilot::DEFAULT,
16075 base_mode: MavModeFlag::DEFAULT,
16076 system_status: MavState::DEFAULT,
16077 mavlink_version: MINOR_MAVLINK_VERSION,
16078 };
16079 #[cfg(feature = "arbitrary")]
16080 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16081 use arbitrary::{Arbitrary, Unstructured};
16082 let mut buf = [0u8; 1024];
16083 rng.fill_bytes(&mut buf);
16084 let mut unstructured = Unstructured::new(&buf);
16085 Self::arbitrary(&mut unstructured).unwrap_or_default()
16086 }
16087}
16088impl Default for HEARTBEAT_DATA {
16089 fn default() -> Self {
16090 Self::DEFAULT.clone()
16091 }
16092}
16093impl MessageData for HEARTBEAT_DATA {
16094 type Message = MavMessage;
16095 const ID: u32 = 0u32;
16096 const NAME: &'static str = "HEARTBEAT";
16097 const EXTRA_CRC: u8 = 50u8;
16098 const ENCODED_LEN: usize = 9usize;
16099 fn deser(
16100 _version: MavlinkVersion,
16101 __input: &[u8],
16102 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16103 let avail_len = __input.len();
16104 let mut payload_buf = [0; Self::ENCODED_LEN];
16105 let mut buf = if avail_len < Self::ENCODED_LEN {
16106 payload_buf[0..avail_len].copy_from_slice(__input);
16107 Bytes::new(&payload_buf)
16108 } else {
16109 Bytes::new(__input)
16110 };
16111 let mut __struct = Self::default();
16112 __struct.custom_mode = buf.get_u32_le();
16113 let tmp = buf.get_u8();
16114 __struct.mavtype =
16115 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16116 enum_type: "MavType",
16117 value: tmp as u32,
16118 })?;
16119 let tmp = buf.get_u8();
16120 __struct.autopilot =
16121 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16122 enum_type: "MavAutopilot",
16123 value: tmp as u32,
16124 })?;
16125 let tmp = buf.get_u8();
16126 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
16127 ::mavlink_core::error::ParserError::InvalidFlag {
16128 flag_type: "MavModeFlag",
16129 value: tmp as u32,
16130 },
16131 )?;
16132 let tmp = buf.get_u8();
16133 __struct.system_status =
16134 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16135 enum_type: "MavState",
16136 value: tmp as u32,
16137 })?;
16138 __struct.mavlink_version = buf.get_u8();
16139 Ok(__struct)
16140 }
16141 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16142 let mut __tmp = BytesMut::new(bytes);
16143 #[allow(clippy::absurd_extreme_comparisons)]
16144 #[allow(unused_comparisons)]
16145 if __tmp.remaining() < Self::ENCODED_LEN {
16146 panic!(
16147 "buffer is too small (need {} bytes, but got {})",
16148 Self::ENCODED_LEN,
16149 __tmp.remaining(),
16150 )
16151 }
16152 __tmp.put_u32_le(self.custom_mode);
16153 __tmp.put_u8(self.mavtype as u8);
16154 __tmp.put_u8(self.autopilot as u8);
16155 __tmp.put_u8(self.base_mode.bits());
16156 __tmp.put_u8(self.system_status as u8);
16157 __tmp.put_u8(self.mavlink_version);
16158 if matches!(version, MavlinkVersion::V2) {
16159 let len = __tmp.len();
16160 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16161 } else {
16162 __tmp.len()
16163 }
16164 }
16165}
16166#[doc = "The IMU readings in SI units in NED body frame."]
16167#[doc = ""]
16168#[doc = "ID: 105"]
16169#[derive(Debug, Clone, PartialEq)]
16170#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16171#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16172#[cfg_attr(feature = "ts", derive(TS))]
16173#[cfg_attr(feature = "ts", ts(export))]
16174pub struct HIGHRES_IMU_DATA {
16175 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16176 pub time_usec: u64,
16177 #[doc = "X acceleration"]
16178 pub xacc: f32,
16179 #[doc = "Y acceleration"]
16180 pub yacc: f32,
16181 #[doc = "Z acceleration"]
16182 pub zacc: f32,
16183 #[doc = "Angular speed around X axis"]
16184 pub xgyro: f32,
16185 #[doc = "Angular speed around Y axis"]
16186 pub ygyro: f32,
16187 #[doc = "Angular speed around Z axis"]
16188 pub zgyro: f32,
16189 #[doc = "X Magnetic field"]
16190 pub xmag: f32,
16191 #[doc = "Y Magnetic field"]
16192 pub ymag: f32,
16193 #[doc = "Z Magnetic field"]
16194 pub zmag: f32,
16195 #[doc = "Absolute pressure"]
16196 pub abs_pressure: f32,
16197 #[doc = "Differential pressure"]
16198 pub diff_pressure: f32,
16199 #[doc = "Altitude calculated from pressure"]
16200 pub pressure_alt: f32,
16201 #[doc = "Temperature"]
16202 pub temperature: f32,
16203 #[doc = "Bitmap for fields that have updated since last message"]
16204 pub fields_updated: HighresImuUpdatedFlags,
16205 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
16206 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16207 pub id: u8,
16208}
16209impl HIGHRES_IMU_DATA {
16210 pub const ENCODED_LEN: usize = 63usize;
16211 pub const DEFAULT: Self = Self {
16212 time_usec: 0_u64,
16213 xacc: 0.0_f32,
16214 yacc: 0.0_f32,
16215 zacc: 0.0_f32,
16216 xgyro: 0.0_f32,
16217 ygyro: 0.0_f32,
16218 zgyro: 0.0_f32,
16219 xmag: 0.0_f32,
16220 ymag: 0.0_f32,
16221 zmag: 0.0_f32,
16222 abs_pressure: 0.0_f32,
16223 diff_pressure: 0.0_f32,
16224 pressure_alt: 0.0_f32,
16225 temperature: 0.0_f32,
16226 fields_updated: HighresImuUpdatedFlags::DEFAULT,
16227 id: 0_u8,
16228 };
16229 #[cfg(feature = "arbitrary")]
16230 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16231 use arbitrary::{Arbitrary, Unstructured};
16232 let mut buf = [0u8; 1024];
16233 rng.fill_bytes(&mut buf);
16234 let mut unstructured = Unstructured::new(&buf);
16235 Self::arbitrary(&mut unstructured).unwrap_or_default()
16236 }
16237}
16238impl Default for HIGHRES_IMU_DATA {
16239 fn default() -> Self {
16240 Self::DEFAULT.clone()
16241 }
16242}
16243impl MessageData for HIGHRES_IMU_DATA {
16244 type Message = MavMessage;
16245 const ID: u32 = 105u32;
16246 const NAME: &'static str = "HIGHRES_IMU";
16247 const EXTRA_CRC: u8 = 93u8;
16248 const ENCODED_LEN: usize = 63usize;
16249 fn deser(
16250 _version: MavlinkVersion,
16251 __input: &[u8],
16252 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16253 let avail_len = __input.len();
16254 let mut payload_buf = [0; Self::ENCODED_LEN];
16255 let mut buf = if avail_len < Self::ENCODED_LEN {
16256 payload_buf[0..avail_len].copy_from_slice(__input);
16257 Bytes::new(&payload_buf)
16258 } else {
16259 Bytes::new(__input)
16260 };
16261 let mut __struct = Self::default();
16262 __struct.time_usec = buf.get_u64_le();
16263 __struct.xacc = buf.get_f32_le();
16264 __struct.yacc = buf.get_f32_le();
16265 __struct.zacc = buf.get_f32_le();
16266 __struct.xgyro = buf.get_f32_le();
16267 __struct.ygyro = buf.get_f32_le();
16268 __struct.zgyro = buf.get_f32_le();
16269 __struct.xmag = buf.get_f32_le();
16270 __struct.ymag = buf.get_f32_le();
16271 __struct.zmag = buf.get_f32_le();
16272 __struct.abs_pressure = buf.get_f32_le();
16273 __struct.diff_pressure = buf.get_f32_le();
16274 __struct.pressure_alt = buf.get_f32_le();
16275 __struct.temperature = buf.get_f32_le();
16276 let tmp = buf.get_u16_le();
16277 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
16278 tmp & HighresImuUpdatedFlags::all().bits(),
16279 )
16280 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16281 flag_type: "HighresImuUpdatedFlags",
16282 value: tmp as u32,
16283 })?;
16284 __struct.id = buf.get_u8();
16285 Ok(__struct)
16286 }
16287 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16288 let mut __tmp = BytesMut::new(bytes);
16289 #[allow(clippy::absurd_extreme_comparisons)]
16290 #[allow(unused_comparisons)]
16291 if __tmp.remaining() < Self::ENCODED_LEN {
16292 panic!(
16293 "buffer is too small (need {} bytes, but got {})",
16294 Self::ENCODED_LEN,
16295 __tmp.remaining(),
16296 )
16297 }
16298 __tmp.put_u64_le(self.time_usec);
16299 __tmp.put_f32_le(self.xacc);
16300 __tmp.put_f32_le(self.yacc);
16301 __tmp.put_f32_le(self.zacc);
16302 __tmp.put_f32_le(self.xgyro);
16303 __tmp.put_f32_le(self.ygyro);
16304 __tmp.put_f32_le(self.zgyro);
16305 __tmp.put_f32_le(self.xmag);
16306 __tmp.put_f32_le(self.ymag);
16307 __tmp.put_f32_le(self.zmag);
16308 __tmp.put_f32_le(self.abs_pressure);
16309 __tmp.put_f32_le(self.diff_pressure);
16310 __tmp.put_f32_le(self.pressure_alt);
16311 __tmp.put_f32_le(self.temperature);
16312 __tmp.put_u16_le(self.fields_updated.bits());
16313 if matches!(version, MavlinkVersion::V2) {
16314 __tmp.put_u8(self.id);
16315 let len = __tmp.len();
16316 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16317 } else {
16318 __tmp.len()
16319 }
16320 }
16321}
16322#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
16323#[doc = "Message appropriate for high latency connections like Iridium."]
16324#[doc = ""]
16325#[doc = "ID: 234"]
16326#[derive(Debug, Clone, PartialEq)]
16327#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16328#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16329#[cfg_attr(feature = "ts", derive(TS))]
16330#[cfg_attr(feature = "ts", ts(export))]
16331pub struct HIGH_LATENCY_DATA {
16332 #[doc = "A bitfield for use for autopilot-specific flags."]
16333 pub custom_mode: u32,
16334 #[doc = "Latitude"]
16335 pub latitude: i32,
16336 #[doc = "Longitude"]
16337 pub longitude: i32,
16338 #[doc = "roll"]
16339 pub roll: i16,
16340 #[doc = "pitch"]
16341 pub pitch: i16,
16342 #[doc = "heading"]
16343 pub heading: u16,
16344 #[doc = "heading setpoint"]
16345 pub heading_sp: i16,
16346 #[doc = "Altitude above mean sea level"]
16347 pub altitude_amsl: i16,
16348 #[doc = "Altitude setpoint relative to the home position"]
16349 pub altitude_sp: i16,
16350 #[doc = "distance to target"]
16351 pub wp_distance: u16,
16352 #[doc = "Bitmap of enabled system modes."]
16353 pub base_mode: MavModeFlag,
16354 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
16355 pub landed_state: MavLandedState,
16356 #[doc = "throttle (percentage)"]
16357 pub throttle: i8,
16358 #[doc = "airspeed"]
16359 pub airspeed: u8,
16360 #[doc = "airspeed setpoint"]
16361 pub airspeed_sp: u8,
16362 #[doc = "groundspeed"]
16363 pub groundspeed: u8,
16364 #[doc = "climb rate"]
16365 pub climb_rate: i8,
16366 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16367 pub gps_nsat: u8,
16368 #[doc = "GPS Fix type."]
16369 pub gps_fix_type: GpsFixType,
16370 #[doc = "Remaining battery (percentage)"]
16371 pub battery_remaining: u8,
16372 #[doc = "Autopilot temperature (degrees C)"]
16373 pub temperature: i8,
16374 #[doc = "Air temperature (degrees C) from airspeed sensor"]
16375 pub temperature_air: i8,
16376 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
16377 pub failsafe: u8,
16378 #[doc = "current waypoint number"]
16379 pub wp_num: u8,
16380}
16381impl HIGH_LATENCY_DATA {
16382 pub const ENCODED_LEN: usize = 40usize;
16383 pub const DEFAULT: Self = Self {
16384 custom_mode: 0_u32,
16385 latitude: 0_i32,
16386 longitude: 0_i32,
16387 roll: 0_i16,
16388 pitch: 0_i16,
16389 heading: 0_u16,
16390 heading_sp: 0_i16,
16391 altitude_amsl: 0_i16,
16392 altitude_sp: 0_i16,
16393 wp_distance: 0_u16,
16394 base_mode: MavModeFlag::DEFAULT,
16395 landed_state: MavLandedState::DEFAULT,
16396 throttle: 0_i8,
16397 airspeed: 0_u8,
16398 airspeed_sp: 0_u8,
16399 groundspeed: 0_u8,
16400 climb_rate: 0_i8,
16401 gps_nsat: 0_u8,
16402 gps_fix_type: GpsFixType::DEFAULT,
16403 battery_remaining: 0_u8,
16404 temperature: 0_i8,
16405 temperature_air: 0_i8,
16406 failsafe: 0_u8,
16407 wp_num: 0_u8,
16408 };
16409 #[cfg(feature = "arbitrary")]
16410 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16411 use arbitrary::{Arbitrary, Unstructured};
16412 let mut buf = [0u8; 1024];
16413 rng.fill_bytes(&mut buf);
16414 let mut unstructured = Unstructured::new(&buf);
16415 Self::arbitrary(&mut unstructured).unwrap_or_default()
16416 }
16417}
16418impl Default for HIGH_LATENCY_DATA {
16419 fn default() -> Self {
16420 Self::DEFAULT.clone()
16421 }
16422}
16423impl MessageData for HIGH_LATENCY_DATA {
16424 type Message = MavMessage;
16425 const ID: u32 = 234u32;
16426 const NAME: &'static str = "HIGH_LATENCY";
16427 const EXTRA_CRC: u8 = 150u8;
16428 const ENCODED_LEN: usize = 40usize;
16429 fn deser(
16430 _version: MavlinkVersion,
16431 __input: &[u8],
16432 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16433 let avail_len = __input.len();
16434 let mut payload_buf = [0; Self::ENCODED_LEN];
16435 let mut buf = if avail_len < Self::ENCODED_LEN {
16436 payload_buf[0..avail_len].copy_from_slice(__input);
16437 Bytes::new(&payload_buf)
16438 } else {
16439 Bytes::new(__input)
16440 };
16441 let mut __struct = Self::default();
16442 __struct.custom_mode = buf.get_u32_le();
16443 __struct.latitude = buf.get_i32_le();
16444 __struct.longitude = buf.get_i32_le();
16445 __struct.roll = buf.get_i16_le();
16446 __struct.pitch = buf.get_i16_le();
16447 __struct.heading = buf.get_u16_le();
16448 __struct.heading_sp = buf.get_i16_le();
16449 __struct.altitude_amsl = buf.get_i16_le();
16450 __struct.altitude_sp = buf.get_i16_le();
16451 __struct.wp_distance = buf.get_u16_le();
16452 let tmp = buf.get_u8();
16453 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
16454 ::mavlink_core::error::ParserError::InvalidFlag {
16455 flag_type: "MavModeFlag",
16456 value: tmp as u32,
16457 },
16458 )?;
16459 let tmp = buf.get_u8();
16460 __struct.landed_state =
16461 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16462 enum_type: "MavLandedState",
16463 value: tmp as u32,
16464 })?;
16465 __struct.throttle = buf.get_i8();
16466 __struct.airspeed = buf.get_u8();
16467 __struct.airspeed_sp = buf.get_u8();
16468 __struct.groundspeed = buf.get_u8();
16469 __struct.climb_rate = buf.get_i8();
16470 __struct.gps_nsat = buf.get_u8();
16471 let tmp = buf.get_u8();
16472 __struct.gps_fix_type =
16473 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16474 enum_type: "GpsFixType",
16475 value: tmp as u32,
16476 })?;
16477 __struct.battery_remaining = buf.get_u8();
16478 __struct.temperature = buf.get_i8();
16479 __struct.temperature_air = buf.get_i8();
16480 __struct.failsafe = buf.get_u8();
16481 __struct.wp_num = buf.get_u8();
16482 Ok(__struct)
16483 }
16484 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16485 let mut __tmp = BytesMut::new(bytes);
16486 #[allow(clippy::absurd_extreme_comparisons)]
16487 #[allow(unused_comparisons)]
16488 if __tmp.remaining() < Self::ENCODED_LEN {
16489 panic!(
16490 "buffer is too small (need {} bytes, but got {})",
16491 Self::ENCODED_LEN,
16492 __tmp.remaining(),
16493 )
16494 }
16495 __tmp.put_u32_le(self.custom_mode);
16496 __tmp.put_i32_le(self.latitude);
16497 __tmp.put_i32_le(self.longitude);
16498 __tmp.put_i16_le(self.roll);
16499 __tmp.put_i16_le(self.pitch);
16500 __tmp.put_u16_le(self.heading);
16501 __tmp.put_i16_le(self.heading_sp);
16502 __tmp.put_i16_le(self.altitude_amsl);
16503 __tmp.put_i16_le(self.altitude_sp);
16504 __tmp.put_u16_le(self.wp_distance);
16505 __tmp.put_u8(self.base_mode.bits());
16506 __tmp.put_u8(self.landed_state as u8);
16507 __tmp.put_i8(self.throttle);
16508 __tmp.put_u8(self.airspeed);
16509 __tmp.put_u8(self.airspeed_sp);
16510 __tmp.put_u8(self.groundspeed);
16511 __tmp.put_i8(self.climb_rate);
16512 __tmp.put_u8(self.gps_nsat);
16513 __tmp.put_u8(self.gps_fix_type as u8);
16514 __tmp.put_u8(self.battery_remaining);
16515 __tmp.put_i8(self.temperature);
16516 __tmp.put_i8(self.temperature_air);
16517 __tmp.put_u8(self.failsafe);
16518 __tmp.put_u8(self.wp_num);
16519 if matches!(version, MavlinkVersion::V2) {
16520 let len = __tmp.len();
16521 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16522 } else {
16523 __tmp.len()
16524 }
16525 }
16526}
16527#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
16528#[doc = ""]
16529#[doc = "ID: 235"]
16530#[derive(Debug, Clone, PartialEq)]
16531#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16533#[cfg_attr(feature = "ts", derive(TS))]
16534#[cfg_attr(feature = "ts", ts(export))]
16535pub struct HIGH_LATENCY2_DATA {
16536 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
16537 pub timestamp: u32,
16538 #[doc = "Latitude"]
16539 pub latitude: i32,
16540 #[doc = "Longitude"]
16541 pub longitude: i32,
16542 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
16543 pub custom_mode: u16,
16544 #[doc = "Altitude above mean sea level"]
16545 pub altitude: i16,
16546 #[doc = "Altitude setpoint"]
16547 pub target_altitude: i16,
16548 #[doc = "Distance to target waypoint or position"]
16549 pub target_distance: u16,
16550 #[doc = "Current waypoint number"]
16551 pub wp_num: u16,
16552 #[doc = "Bitmap of failure flags."]
16553 pub failure_flags: HlFailureFlag,
16554 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
16555 pub mavtype: MavType,
16556 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
16557 pub autopilot: MavAutopilot,
16558 #[doc = "Heading"]
16559 pub heading: u8,
16560 #[doc = "Heading setpoint"]
16561 pub target_heading: u8,
16562 #[doc = "Throttle"]
16563 pub throttle: u8,
16564 #[doc = "Airspeed"]
16565 pub airspeed: u8,
16566 #[doc = "Airspeed setpoint"]
16567 pub airspeed_sp: u8,
16568 #[doc = "Groundspeed"]
16569 pub groundspeed: u8,
16570 #[doc = "Windspeed"]
16571 pub windspeed: u8,
16572 #[doc = "Wind heading"]
16573 pub wind_heading: u8,
16574 #[doc = "Maximum error horizontal position since last message"]
16575 pub eph: u8,
16576 #[doc = "Maximum error vertical position since last message"]
16577 pub epv: u8,
16578 #[doc = "Air temperature"]
16579 pub temperature_air: i8,
16580 #[doc = "Maximum climb rate magnitude since last message"]
16581 pub climb_rate: i8,
16582 #[doc = "Battery level (-1 if field not provided)."]
16583 pub battery: i8,
16584 #[doc = "Field for custom payload."]
16585 pub custom0: i8,
16586 #[doc = "Field for custom payload."]
16587 pub custom1: i8,
16588 #[doc = "Field for custom payload."]
16589 pub custom2: i8,
16590}
16591impl HIGH_LATENCY2_DATA {
16592 pub const ENCODED_LEN: usize = 42usize;
16593 pub const DEFAULT: Self = Self {
16594 timestamp: 0_u32,
16595 latitude: 0_i32,
16596 longitude: 0_i32,
16597 custom_mode: 0_u16,
16598 altitude: 0_i16,
16599 target_altitude: 0_i16,
16600 target_distance: 0_u16,
16601 wp_num: 0_u16,
16602 failure_flags: HlFailureFlag::DEFAULT,
16603 mavtype: MavType::DEFAULT,
16604 autopilot: MavAutopilot::DEFAULT,
16605 heading: 0_u8,
16606 target_heading: 0_u8,
16607 throttle: 0_u8,
16608 airspeed: 0_u8,
16609 airspeed_sp: 0_u8,
16610 groundspeed: 0_u8,
16611 windspeed: 0_u8,
16612 wind_heading: 0_u8,
16613 eph: 0_u8,
16614 epv: 0_u8,
16615 temperature_air: 0_i8,
16616 climb_rate: 0_i8,
16617 battery: 0_i8,
16618 custom0: 0_i8,
16619 custom1: 0_i8,
16620 custom2: 0_i8,
16621 };
16622 #[cfg(feature = "arbitrary")]
16623 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16624 use arbitrary::{Arbitrary, Unstructured};
16625 let mut buf = [0u8; 1024];
16626 rng.fill_bytes(&mut buf);
16627 let mut unstructured = Unstructured::new(&buf);
16628 Self::arbitrary(&mut unstructured).unwrap_or_default()
16629 }
16630}
16631impl Default for HIGH_LATENCY2_DATA {
16632 fn default() -> Self {
16633 Self::DEFAULT.clone()
16634 }
16635}
16636impl MessageData for HIGH_LATENCY2_DATA {
16637 type Message = MavMessage;
16638 const ID: u32 = 235u32;
16639 const NAME: &'static str = "HIGH_LATENCY2";
16640 const EXTRA_CRC: u8 = 179u8;
16641 const ENCODED_LEN: usize = 42usize;
16642 fn deser(
16643 _version: MavlinkVersion,
16644 __input: &[u8],
16645 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16646 let avail_len = __input.len();
16647 let mut payload_buf = [0; Self::ENCODED_LEN];
16648 let mut buf = if avail_len < Self::ENCODED_LEN {
16649 payload_buf[0..avail_len].copy_from_slice(__input);
16650 Bytes::new(&payload_buf)
16651 } else {
16652 Bytes::new(__input)
16653 };
16654 let mut __struct = Self::default();
16655 __struct.timestamp = buf.get_u32_le();
16656 __struct.latitude = buf.get_i32_le();
16657 __struct.longitude = buf.get_i32_le();
16658 __struct.custom_mode = buf.get_u16_le();
16659 __struct.altitude = buf.get_i16_le();
16660 __struct.target_altitude = buf.get_i16_le();
16661 __struct.target_distance = buf.get_u16_le();
16662 __struct.wp_num = buf.get_u16_le();
16663 let tmp = buf.get_u16_le();
16664 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
16665 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16666 flag_type: "HlFailureFlag",
16667 value: tmp as u32,
16668 })?;
16669 let tmp = buf.get_u8();
16670 __struct.mavtype =
16671 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16672 enum_type: "MavType",
16673 value: tmp as u32,
16674 })?;
16675 let tmp = buf.get_u8();
16676 __struct.autopilot =
16677 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16678 enum_type: "MavAutopilot",
16679 value: tmp as u32,
16680 })?;
16681 __struct.heading = buf.get_u8();
16682 __struct.target_heading = buf.get_u8();
16683 __struct.throttle = buf.get_u8();
16684 __struct.airspeed = buf.get_u8();
16685 __struct.airspeed_sp = buf.get_u8();
16686 __struct.groundspeed = buf.get_u8();
16687 __struct.windspeed = buf.get_u8();
16688 __struct.wind_heading = buf.get_u8();
16689 __struct.eph = buf.get_u8();
16690 __struct.epv = buf.get_u8();
16691 __struct.temperature_air = buf.get_i8();
16692 __struct.climb_rate = buf.get_i8();
16693 __struct.battery = buf.get_i8();
16694 __struct.custom0 = buf.get_i8();
16695 __struct.custom1 = buf.get_i8();
16696 __struct.custom2 = buf.get_i8();
16697 Ok(__struct)
16698 }
16699 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16700 let mut __tmp = BytesMut::new(bytes);
16701 #[allow(clippy::absurd_extreme_comparisons)]
16702 #[allow(unused_comparisons)]
16703 if __tmp.remaining() < Self::ENCODED_LEN {
16704 panic!(
16705 "buffer is too small (need {} bytes, but got {})",
16706 Self::ENCODED_LEN,
16707 __tmp.remaining(),
16708 )
16709 }
16710 __tmp.put_u32_le(self.timestamp);
16711 __tmp.put_i32_le(self.latitude);
16712 __tmp.put_i32_le(self.longitude);
16713 __tmp.put_u16_le(self.custom_mode);
16714 __tmp.put_i16_le(self.altitude);
16715 __tmp.put_i16_le(self.target_altitude);
16716 __tmp.put_u16_le(self.target_distance);
16717 __tmp.put_u16_le(self.wp_num);
16718 __tmp.put_u16_le(self.failure_flags.bits());
16719 __tmp.put_u8(self.mavtype as u8);
16720 __tmp.put_u8(self.autopilot as u8);
16721 __tmp.put_u8(self.heading);
16722 __tmp.put_u8(self.target_heading);
16723 __tmp.put_u8(self.throttle);
16724 __tmp.put_u8(self.airspeed);
16725 __tmp.put_u8(self.airspeed_sp);
16726 __tmp.put_u8(self.groundspeed);
16727 __tmp.put_u8(self.windspeed);
16728 __tmp.put_u8(self.wind_heading);
16729 __tmp.put_u8(self.eph);
16730 __tmp.put_u8(self.epv);
16731 __tmp.put_i8(self.temperature_air);
16732 __tmp.put_i8(self.climb_rate);
16733 __tmp.put_i8(self.battery);
16734 __tmp.put_i8(self.custom0);
16735 __tmp.put_i8(self.custom1);
16736 __tmp.put_i8(self.custom2);
16737 if matches!(version, MavlinkVersion::V2) {
16738 let len = __tmp.len();
16739 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16740 } else {
16741 __tmp.len()
16742 }
16743 }
16744}
16745#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
16746#[doc = ""]
16747#[doc = "ID: 93"]
16748#[derive(Debug, Clone, PartialEq)]
16749#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16750#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16751#[cfg_attr(feature = "ts", derive(TS))]
16752#[cfg_attr(feature = "ts", ts(export))]
16753pub struct HIL_ACTUATOR_CONTROLS_DATA {
16754 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16755 pub time_usec: u64,
16756 #[doc = "Flags bitmask."]
16757 pub flags: HilActuatorControlsFlags,
16758 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
16759 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16760 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16761 pub controls: [f32; 16],
16762 #[doc = "System mode. Includes arming state."]
16763 pub mode: MavModeFlag,
16764}
16765impl HIL_ACTUATOR_CONTROLS_DATA {
16766 pub const ENCODED_LEN: usize = 81usize;
16767 pub const DEFAULT: Self = Self {
16768 time_usec: 0_u64,
16769 flags: HilActuatorControlsFlags::DEFAULT,
16770 controls: [0.0_f32; 16usize],
16771 mode: MavModeFlag::DEFAULT,
16772 };
16773 #[cfg(feature = "arbitrary")]
16774 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16775 use arbitrary::{Arbitrary, Unstructured};
16776 let mut buf = [0u8; 1024];
16777 rng.fill_bytes(&mut buf);
16778 let mut unstructured = Unstructured::new(&buf);
16779 Self::arbitrary(&mut unstructured).unwrap_or_default()
16780 }
16781}
16782impl Default for HIL_ACTUATOR_CONTROLS_DATA {
16783 fn default() -> Self {
16784 Self::DEFAULT.clone()
16785 }
16786}
16787impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
16788 type Message = MavMessage;
16789 const ID: u32 = 93u32;
16790 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
16791 const EXTRA_CRC: u8 = 47u8;
16792 const ENCODED_LEN: usize = 81usize;
16793 fn deser(
16794 _version: MavlinkVersion,
16795 __input: &[u8],
16796 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16797 let avail_len = __input.len();
16798 let mut payload_buf = [0; Self::ENCODED_LEN];
16799 let mut buf = if avail_len < Self::ENCODED_LEN {
16800 payload_buf[0..avail_len].copy_from_slice(__input);
16801 Bytes::new(&payload_buf)
16802 } else {
16803 Bytes::new(__input)
16804 };
16805 let mut __struct = Self::default();
16806 __struct.time_usec = buf.get_u64_le();
16807 let tmp = buf.get_u64_le();
16808 __struct.flags =
16809 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
16810 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16811 flag_type: "HilActuatorControlsFlags",
16812 value: tmp as u32,
16813 })?;
16814 for v in &mut __struct.controls {
16815 let val = buf.get_f32_le();
16816 *v = val;
16817 }
16818 let tmp = buf.get_u8();
16819 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
16820 ::mavlink_core::error::ParserError::InvalidFlag {
16821 flag_type: "MavModeFlag",
16822 value: tmp as u32,
16823 },
16824 )?;
16825 Ok(__struct)
16826 }
16827 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16828 let mut __tmp = BytesMut::new(bytes);
16829 #[allow(clippy::absurd_extreme_comparisons)]
16830 #[allow(unused_comparisons)]
16831 if __tmp.remaining() < Self::ENCODED_LEN {
16832 panic!(
16833 "buffer is too small (need {} bytes, but got {})",
16834 Self::ENCODED_LEN,
16835 __tmp.remaining(),
16836 )
16837 }
16838 __tmp.put_u64_le(self.time_usec);
16839 __tmp.put_u64_le(self.flags.bits());
16840 for val in &self.controls {
16841 __tmp.put_f32_le(*val);
16842 }
16843 __tmp.put_u8(self.mode.bits());
16844 if matches!(version, MavlinkVersion::V2) {
16845 let len = __tmp.len();
16846 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16847 } else {
16848 __tmp.len()
16849 }
16850 }
16851}
16852#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
16853#[doc = ""]
16854#[doc = "ID: 91"]
16855#[derive(Debug, Clone, PartialEq)]
16856#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16857#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16858#[cfg_attr(feature = "ts", derive(TS))]
16859#[cfg_attr(feature = "ts", ts(export))]
16860pub struct HIL_CONTROLS_DATA {
16861 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16862 pub time_usec: u64,
16863 #[doc = "Control output -1 .. 1"]
16864 pub roll_ailerons: f32,
16865 #[doc = "Control output -1 .. 1"]
16866 pub pitch_elevator: f32,
16867 #[doc = "Control output -1 .. 1"]
16868 pub yaw_rudder: f32,
16869 #[doc = "Throttle 0 .. 1"]
16870 pub throttle: f32,
16871 #[doc = "Aux 1, -1 .. 1"]
16872 pub aux1: f32,
16873 #[doc = "Aux 2, -1 .. 1"]
16874 pub aux2: f32,
16875 #[doc = "Aux 3, -1 .. 1"]
16876 pub aux3: f32,
16877 #[doc = "Aux 4, -1 .. 1"]
16878 pub aux4: f32,
16879 #[doc = "System mode."]
16880 pub mode: MavMode,
16881 #[doc = "Navigation mode (MAV_NAV_MODE)"]
16882 pub nav_mode: u8,
16883}
16884impl HIL_CONTROLS_DATA {
16885 pub const ENCODED_LEN: usize = 42usize;
16886 pub const DEFAULT: Self = Self {
16887 time_usec: 0_u64,
16888 roll_ailerons: 0.0_f32,
16889 pitch_elevator: 0.0_f32,
16890 yaw_rudder: 0.0_f32,
16891 throttle: 0.0_f32,
16892 aux1: 0.0_f32,
16893 aux2: 0.0_f32,
16894 aux3: 0.0_f32,
16895 aux4: 0.0_f32,
16896 mode: MavMode::DEFAULT,
16897 nav_mode: 0_u8,
16898 };
16899 #[cfg(feature = "arbitrary")]
16900 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16901 use arbitrary::{Arbitrary, Unstructured};
16902 let mut buf = [0u8; 1024];
16903 rng.fill_bytes(&mut buf);
16904 let mut unstructured = Unstructured::new(&buf);
16905 Self::arbitrary(&mut unstructured).unwrap_or_default()
16906 }
16907}
16908impl Default for HIL_CONTROLS_DATA {
16909 fn default() -> Self {
16910 Self::DEFAULT.clone()
16911 }
16912}
16913impl MessageData for HIL_CONTROLS_DATA {
16914 type Message = MavMessage;
16915 const ID: u32 = 91u32;
16916 const NAME: &'static str = "HIL_CONTROLS";
16917 const EXTRA_CRC: u8 = 63u8;
16918 const ENCODED_LEN: usize = 42usize;
16919 fn deser(
16920 _version: MavlinkVersion,
16921 __input: &[u8],
16922 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16923 let avail_len = __input.len();
16924 let mut payload_buf = [0; Self::ENCODED_LEN];
16925 let mut buf = if avail_len < Self::ENCODED_LEN {
16926 payload_buf[0..avail_len].copy_from_slice(__input);
16927 Bytes::new(&payload_buf)
16928 } else {
16929 Bytes::new(__input)
16930 };
16931 let mut __struct = Self::default();
16932 __struct.time_usec = buf.get_u64_le();
16933 __struct.roll_ailerons = buf.get_f32_le();
16934 __struct.pitch_elevator = buf.get_f32_le();
16935 __struct.yaw_rudder = buf.get_f32_le();
16936 __struct.throttle = buf.get_f32_le();
16937 __struct.aux1 = buf.get_f32_le();
16938 __struct.aux2 = buf.get_f32_le();
16939 __struct.aux3 = buf.get_f32_le();
16940 __struct.aux4 = buf.get_f32_le();
16941 let tmp = buf.get_u8();
16942 __struct.mode =
16943 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16944 enum_type: "MavMode",
16945 value: tmp as u32,
16946 })?;
16947 __struct.nav_mode = buf.get_u8();
16948 Ok(__struct)
16949 }
16950 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16951 let mut __tmp = BytesMut::new(bytes);
16952 #[allow(clippy::absurd_extreme_comparisons)]
16953 #[allow(unused_comparisons)]
16954 if __tmp.remaining() < Self::ENCODED_LEN {
16955 panic!(
16956 "buffer is too small (need {} bytes, but got {})",
16957 Self::ENCODED_LEN,
16958 __tmp.remaining(),
16959 )
16960 }
16961 __tmp.put_u64_le(self.time_usec);
16962 __tmp.put_f32_le(self.roll_ailerons);
16963 __tmp.put_f32_le(self.pitch_elevator);
16964 __tmp.put_f32_le(self.yaw_rudder);
16965 __tmp.put_f32_le(self.throttle);
16966 __tmp.put_f32_le(self.aux1);
16967 __tmp.put_f32_le(self.aux2);
16968 __tmp.put_f32_le(self.aux3);
16969 __tmp.put_f32_le(self.aux4);
16970 __tmp.put_u8(self.mode as u8);
16971 __tmp.put_u8(self.nav_mode);
16972 if matches!(version, MavlinkVersion::V2) {
16973 let len = __tmp.len();
16974 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16975 } else {
16976 __tmp.len()
16977 }
16978 }
16979}
16980#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
16981#[doc = ""]
16982#[doc = "ID: 113"]
16983#[derive(Debug, Clone, PartialEq)]
16984#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16985#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16986#[cfg_attr(feature = "ts", derive(TS))]
16987#[cfg_attr(feature = "ts", ts(export))]
16988pub struct HIL_GPS_DATA {
16989 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16990 pub time_usec: u64,
16991 #[doc = "Latitude (WGS84)"]
16992 pub lat: i32,
16993 #[doc = "Longitude (WGS84)"]
16994 pub lon: i32,
16995 #[doc = "Altitude (MSL). Positive for up."]
16996 pub alt: i32,
16997 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16998 pub eph: u16,
16999 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
17000 pub epv: u16,
17001 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
17002 pub vel: u16,
17003 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
17004 pub vn: i16,
17005 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
17006 pub ve: i16,
17007 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
17008 pub vd: i16,
17009 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
17010 pub cog: u16,
17011 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
17012 pub fix_type: u8,
17013 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
17014 pub satellites_visible: u8,
17015 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
17016 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17017 pub id: u8,
17018 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
17019 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17020 pub yaw: u16,
17021}
17022impl HIL_GPS_DATA {
17023 pub const ENCODED_LEN: usize = 39usize;
17024 pub const DEFAULT: Self = Self {
17025 time_usec: 0_u64,
17026 lat: 0_i32,
17027 lon: 0_i32,
17028 alt: 0_i32,
17029 eph: 0_u16,
17030 epv: 0_u16,
17031 vel: 0_u16,
17032 vn: 0_i16,
17033 ve: 0_i16,
17034 vd: 0_i16,
17035 cog: 0_u16,
17036 fix_type: 0_u8,
17037 satellites_visible: 0_u8,
17038 id: 0_u8,
17039 yaw: 0_u16,
17040 };
17041 #[cfg(feature = "arbitrary")]
17042 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17043 use arbitrary::{Arbitrary, Unstructured};
17044 let mut buf = [0u8; 1024];
17045 rng.fill_bytes(&mut buf);
17046 let mut unstructured = Unstructured::new(&buf);
17047 Self::arbitrary(&mut unstructured).unwrap_or_default()
17048 }
17049}
17050impl Default for HIL_GPS_DATA {
17051 fn default() -> Self {
17052 Self::DEFAULT.clone()
17053 }
17054}
17055impl MessageData for HIL_GPS_DATA {
17056 type Message = MavMessage;
17057 const ID: u32 = 113u32;
17058 const NAME: &'static str = "HIL_GPS";
17059 const EXTRA_CRC: u8 = 124u8;
17060 const ENCODED_LEN: usize = 39usize;
17061 fn deser(
17062 _version: MavlinkVersion,
17063 __input: &[u8],
17064 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17065 let avail_len = __input.len();
17066 let mut payload_buf = [0; Self::ENCODED_LEN];
17067 let mut buf = if avail_len < Self::ENCODED_LEN {
17068 payload_buf[0..avail_len].copy_from_slice(__input);
17069 Bytes::new(&payload_buf)
17070 } else {
17071 Bytes::new(__input)
17072 };
17073 let mut __struct = Self::default();
17074 __struct.time_usec = buf.get_u64_le();
17075 __struct.lat = buf.get_i32_le();
17076 __struct.lon = buf.get_i32_le();
17077 __struct.alt = buf.get_i32_le();
17078 __struct.eph = buf.get_u16_le();
17079 __struct.epv = buf.get_u16_le();
17080 __struct.vel = buf.get_u16_le();
17081 __struct.vn = buf.get_i16_le();
17082 __struct.ve = buf.get_i16_le();
17083 __struct.vd = buf.get_i16_le();
17084 __struct.cog = buf.get_u16_le();
17085 __struct.fix_type = buf.get_u8();
17086 __struct.satellites_visible = buf.get_u8();
17087 __struct.id = buf.get_u8();
17088 __struct.yaw = buf.get_u16_le();
17089 Ok(__struct)
17090 }
17091 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17092 let mut __tmp = BytesMut::new(bytes);
17093 #[allow(clippy::absurd_extreme_comparisons)]
17094 #[allow(unused_comparisons)]
17095 if __tmp.remaining() < Self::ENCODED_LEN {
17096 panic!(
17097 "buffer is too small (need {} bytes, but got {})",
17098 Self::ENCODED_LEN,
17099 __tmp.remaining(),
17100 )
17101 }
17102 __tmp.put_u64_le(self.time_usec);
17103 __tmp.put_i32_le(self.lat);
17104 __tmp.put_i32_le(self.lon);
17105 __tmp.put_i32_le(self.alt);
17106 __tmp.put_u16_le(self.eph);
17107 __tmp.put_u16_le(self.epv);
17108 __tmp.put_u16_le(self.vel);
17109 __tmp.put_i16_le(self.vn);
17110 __tmp.put_i16_le(self.ve);
17111 __tmp.put_i16_le(self.vd);
17112 __tmp.put_u16_le(self.cog);
17113 __tmp.put_u8(self.fix_type);
17114 __tmp.put_u8(self.satellites_visible);
17115 if matches!(version, MavlinkVersion::V2) {
17116 __tmp.put_u8(self.id);
17117 __tmp.put_u16_le(self.yaw);
17118 let len = __tmp.len();
17119 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17120 } else {
17121 __tmp.len()
17122 }
17123 }
17124}
17125#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
17126#[doc = ""]
17127#[doc = "ID: 114"]
17128#[derive(Debug, Clone, PartialEq)]
17129#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17131#[cfg_attr(feature = "ts", derive(TS))]
17132#[cfg_attr(feature = "ts", ts(export))]
17133pub struct HIL_OPTICAL_FLOW_DATA {
17134 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17135 pub time_usec: u64,
17136 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
17137 pub integration_time_us: u32,
17138 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
17139 pub integrated_x: f32,
17140 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
17141 pub integrated_y: f32,
17142 #[doc = "RH rotation around X axis"]
17143 pub integrated_xgyro: f32,
17144 #[doc = "RH rotation around Y axis"]
17145 pub integrated_ygyro: f32,
17146 #[doc = "RH rotation around Z axis"]
17147 pub integrated_zgyro: f32,
17148 #[doc = "Time since the distance was sampled."]
17149 pub time_delta_distance_us: u32,
17150 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
17151 pub distance: f32,
17152 #[doc = "Temperature"]
17153 pub temperature: i16,
17154 #[doc = "Sensor ID"]
17155 pub sensor_id: u8,
17156 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
17157 pub quality: u8,
17158}
17159impl HIL_OPTICAL_FLOW_DATA {
17160 pub const ENCODED_LEN: usize = 44usize;
17161 pub const DEFAULT: Self = Self {
17162 time_usec: 0_u64,
17163 integration_time_us: 0_u32,
17164 integrated_x: 0.0_f32,
17165 integrated_y: 0.0_f32,
17166 integrated_xgyro: 0.0_f32,
17167 integrated_ygyro: 0.0_f32,
17168 integrated_zgyro: 0.0_f32,
17169 time_delta_distance_us: 0_u32,
17170 distance: 0.0_f32,
17171 temperature: 0_i16,
17172 sensor_id: 0_u8,
17173 quality: 0_u8,
17174 };
17175 #[cfg(feature = "arbitrary")]
17176 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17177 use arbitrary::{Arbitrary, Unstructured};
17178 let mut buf = [0u8; 1024];
17179 rng.fill_bytes(&mut buf);
17180 let mut unstructured = Unstructured::new(&buf);
17181 Self::arbitrary(&mut unstructured).unwrap_or_default()
17182 }
17183}
17184impl Default for HIL_OPTICAL_FLOW_DATA {
17185 fn default() -> Self {
17186 Self::DEFAULT.clone()
17187 }
17188}
17189impl MessageData for HIL_OPTICAL_FLOW_DATA {
17190 type Message = MavMessage;
17191 const ID: u32 = 114u32;
17192 const NAME: &'static str = "HIL_OPTICAL_FLOW";
17193 const EXTRA_CRC: u8 = 237u8;
17194 const ENCODED_LEN: usize = 44usize;
17195 fn deser(
17196 _version: MavlinkVersion,
17197 __input: &[u8],
17198 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17199 let avail_len = __input.len();
17200 let mut payload_buf = [0; Self::ENCODED_LEN];
17201 let mut buf = if avail_len < Self::ENCODED_LEN {
17202 payload_buf[0..avail_len].copy_from_slice(__input);
17203 Bytes::new(&payload_buf)
17204 } else {
17205 Bytes::new(__input)
17206 };
17207 let mut __struct = Self::default();
17208 __struct.time_usec = buf.get_u64_le();
17209 __struct.integration_time_us = buf.get_u32_le();
17210 __struct.integrated_x = buf.get_f32_le();
17211 __struct.integrated_y = buf.get_f32_le();
17212 __struct.integrated_xgyro = buf.get_f32_le();
17213 __struct.integrated_ygyro = buf.get_f32_le();
17214 __struct.integrated_zgyro = buf.get_f32_le();
17215 __struct.time_delta_distance_us = buf.get_u32_le();
17216 __struct.distance = buf.get_f32_le();
17217 __struct.temperature = buf.get_i16_le();
17218 __struct.sensor_id = buf.get_u8();
17219 __struct.quality = buf.get_u8();
17220 Ok(__struct)
17221 }
17222 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17223 let mut __tmp = BytesMut::new(bytes);
17224 #[allow(clippy::absurd_extreme_comparisons)]
17225 #[allow(unused_comparisons)]
17226 if __tmp.remaining() < Self::ENCODED_LEN {
17227 panic!(
17228 "buffer is too small (need {} bytes, but got {})",
17229 Self::ENCODED_LEN,
17230 __tmp.remaining(),
17231 )
17232 }
17233 __tmp.put_u64_le(self.time_usec);
17234 __tmp.put_u32_le(self.integration_time_us);
17235 __tmp.put_f32_le(self.integrated_x);
17236 __tmp.put_f32_le(self.integrated_y);
17237 __tmp.put_f32_le(self.integrated_xgyro);
17238 __tmp.put_f32_le(self.integrated_ygyro);
17239 __tmp.put_f32_le(self.integrated_zgyro);
17240 __tmp.put_u32_le(self.time_delta_distance_us);
17241 __tmp.put_f32_le(self.distance);
17242 __tmp.put_i16_le(self.temperature);
17243 __tmp.put_u8(self.sensor_id);
17244 __tmp.put_u8(self.quality);
17245 if matches!(version, MavlinkVersion::V2) {
17246 let len = __tmp.len();
17247 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17248 } else {
17249 __tmp.len()
17250 }
17251 }
17252}
17253#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
17254#[doc = ""]
17255#[doc = "ID: 92"]
17256#[derive(Debug, Clone, PartialEq)]
17257#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17258#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17259#[cfg_attr(feature = "ts", derive(TS))]
17260#[cfg_attr(feature = "ts", ts(export))]
17261pub struct HIL_RC_INPUTS_RAW_DATA {
17262 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17263 pub time_usec: u64,
17264 #[doc = "RC channel 1 value"]
17265 pub chan1_raw: u16,
17266 #[doc = "RC channel 2 value"]
17267 pub chan2_raw: u16,
17268 #[doc = "RC channel 3 value"]
17269 pub chan3_raw: u16,
17270 #[doc = "RC channel 4 value"]
17271 pub chan4_raw: u16,
17272 #[doc = "RC channel 5 value"]
17273 pub chan5_raw: u16,
17274 #[doc = "RC channel 6 value"]
17275 pub chan6_raw: u16,
17276 #[doc = "RC channel 7 value"]
17277 pub chan7_raw: u16,
17278 #[doc = "RC channel 8 value"]
17279 pub chan8_raw: u16,
17280 #[doc = "RC channel 9 value"]
17281 pub chan9_raw: u16,
17282 #[doc = "RC channel 10 value"]
17283 pub chan10_raw: u16,
17284 #[doc = "RC channel 11 value"]
17285 pub chan11_raw: u16,
17286 #[doc = "RC channel 12 value"]
17287 pub chan12_raw: u16,
17288 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
17289 pub rssi: u8,
17290}
17291impl HIL_RC_INPUTS_RAW_DATA {
17292 pub const ENCODED_LEN: usize = 33usize;
17293 pub const DEFAULT: Self = Self {
17294 time_usec: 0_u64,
17295 chan1_raw: 0_u16,
17296 chan2_raw: 0_u16,
17297 chan3_raw: 0_u16,
17298 chan4_raw: 0_u16,
17299 chan5_raw: 0_u16,
17300 chan6_raw: 0_u16,
17301 chan7_raw: 0_u16,
17302 chan8_raw: 0_u16,
17303 chan9_raw: 0_u16,
17304 chan10_raw: 0_u16,
17305 chan11_raw: 0_u16,
17306 chan12_raw: 0_u16,
17307 rssi: 0_u8,
17308 };
17309 #[cfg(feature = "arbitrary")]
17310 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17311 use arbitrary::{Arbitrary, Unstructured};
17312 let mut buf = [0u8; 1024];
17313 rng.fill_bytes(&mut buf);
17314 let mut unstructured = Unstructured::new(&buf);
17315 Self::arbitrary(&mut unstructured).unwrap_or_default()
17316 }
17317}
17318impl Default for HIL_RC_INPUTS_RAW_DATA {
17319 fn default() -> Self {
17320 Self::DEFAULT.clone()
17321 }
17322}
17323impl MessageData for HIL_RC_INPUTS_RAW_DATA {
17324 type Message = MavMessage;
17325 const ID: u32 = 92u32;
17326 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
17327 const EXTRA_CRC: u8 = 54u8;
17328 const ENCODED_LEN: usize = 33usize;
17329 fn deser(
17330 _version: MavlinkVersion,
17331 __input: &[u8],
17332 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17333 let avail_len = __input.len();
17334 let mut payload_buf = [0; Self::ENCODED_LEN];
17335 let mut buf = if avail_len < Self::ENCODED_LEN {
17336 payload_buf[0..avail_len].copy_from_slice(__input);
17337 Bytes::new(&payload_buf)
17338 } else {
17339 Bytes::new(__input)
17340 };
17341 let mut __struct = Self::default();
17342 __struct.time_usec = buf.get_u64_le();
17343 __struct.chan1_raw = buf.get_u16_le();
17344 __struct.chan2_raw = buf.get_u16_le();
17345 __struct.chan3_raw = buf.get_u16_le();
17346 __struct.chan4_raw = buf.get_u16_le();
17347 __struct.chan5_raw = buf.get_u16_le();
17348 __struct.chan6_raw = buf.get_u16_le();
17349 __struct.chan7_raw = buf.get_u16_le();
17350 __struct.chan8_raw = buf.get_u16_le();
17351 __struct.chan9_raw = buf.get_u16_le();
17352 __struct.chan10_raw = buf.get_u16_le();
17353 __struct.chan11_raw = buf.get_u16_le();
17354 __struct.chan12_raw = buf.get_u16_le();
17355 __struct.rssi = buf.get_u8();
17356 Ok(__struct)
17357 }
17358 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17359 let mut __tmp = BytesMut::new(bytes);
17360 #[allow(clippy::absurd_extreme_comparisons)]
17361 #[allow(unused_comparisons)]
17362 if __tmp.remaining() < Self::ENCODED_LEN {
17363 panic!(
17364 "buffer is too small (need {} bytes, but got {})",
17365 Self::ENCODED_LEN,
17366 __tmp.remaining(),
17367 )
17368 }
17369 __tmp.put_u64_le(self.time_usec);
17370 __tmp.put_u16_le(self.chan1_raw);
17371 __tmp.put_u16_le(self.chan2_raw);
17372 __tmp.put_u16_le(self.chan3_raw);
17373 __tmp.put_u16_le(self.chan4_raw);
17374 __tmp.put_u16_le(self.chan5_raw);
17375 __tmp.put_u16_le(self.chan6_raw);
17376 __tmp.put_u16_le(self.chan7_raw);
17377 __tmp.put_u16_le(self.chan8_raw);
17378 __tmp.put_u16_le(self.chan9_raw);
17379 __tmp.put_u16_le(self.chan10_raw);
17380 __tmp.put_u16_le(self.chan11_raw);
17381 __tmp.put_u16_le(self.chan12_raw);
17382 __tmp.put_u8(self.rssi);
17383 if matches!(version, MavlinkVersion::V2) {
17384 let len = __tmp.len();
17385 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17386 } else {
17387 __tmp.len()
17388 }
17389 }
17390}
17391#[doc = "The IMU readings in SI units in NED body frame."]
17392#[doc = ""]
17393#[doc = "ID: 107"]
17394#[derive(Debug, Clone, PartialEq)]
17395#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17396#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17397#[cfg_attr(feature = "ts", derive(TS))]
17398#[cfg_attr(feature = "ts", ts(export))]
17399pub struct HIL_SENSOR_DATA {
17400 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17401 pub time_usec: u64,
17402 #[doc = "X acceleration"]
17403 pub xacc: f32,
17404 #[doc = "Y acceleration"]
17405 pub yacc: f32,
17406 #[doc = "Z acceleration"]
17407 pub zacc: f32,
17408 #[doc = "Angular speed around X axis in body frame"]
17409 pub xgyro: f32,
17410 #[doc = "Angular speed around Y axis in body frame"]
17411 pub ygyro: f32,
17412 #[doc = "Angular speed around Z axis in body frame"]
17413 pub zgyro: f32,
17414 #[doc = "X Magnetic field"]
17415 pub xmag: f32,
17416 #[doc = "Y Magnetic field"]
17417 pub ymag: f32,
17418 #[doc = "Z Magnetic field"]
17419 pub zmag: f32,
17420 #[doc = "Absolute pressure"]
17421 pub abs_pressure: f32,
17422 #[doc = "Differential pressure (airspeed)"]
17423 pub diff_pressure: f32,
17424 #[doc = "Altitude calculated from pressure"]
17425 pub pressure_alt: f32,
17426 #[doc = "Temperature"]
17427 pub temperature: f32,
17428 #[doc = "Bitmap for fields that have updated since last message"]
17429 pub fields_updated: HilSensorUpdatedFlags,
17430 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
17431 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17432 pub id: u8,
17433}
17434impl HIL_SENSOR_DATA {
17435 pub const ENCODED_LEN: usize = 65usize;
17436 pub const DEFAULT: Self = Self {
17437 time_usec: 0_u64,
17438 xacc: 0.0_f32,
17439 yacc: 0.0_f32,
17440 zacc: 0.0_f32,
17441 xgyro: 0.0_f32,
17442 ygyro: 0.0_f32,
17443 zgyro: 0.0_f32,
17444 xmag: 0.0_f32,
17445 ymag: 0.0_f32,
17446 zmag: 0.0_f32,
17447 abs_pressure: 0.0_f32,
17448 diff_pressure: 0.0_f32,
17449 pressure_alt: 0.0_f32,
17450 temperature: 0.0_f32,
17451 fields_updated: HilSensorUpdatedFlags::DEFAULT,
17452 id: 0_u8,
17453 };
17454 #[cfg(feature = "arbitrary")]
17455 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17456 use arbitrary::{Arbitrary, Unstructured};
17457 let mut buf = [0u8; 1024];
17458 rng.fill_bytes(&mut buf);
17459 let mut unstructured = Unstructured::new(&buf);
17460 Self::arbitrary(&mut unstructured).unwrap_or_default()
17461 }
17462}
17463impl Default for HIL_SENSOR_DATA {
17464 fn default() -> Self {
17465 Self::DEFAULT.clone()
17466 }
17467}
17468impl MessageData for HIL_SENSOR_DATA {
17469 type Message = MavMessage;
17470 const ID: u32 = 107u32;
17471 const NAME: &'static str = "HIL_SENSOR";
17472 const EXTRA_CRC: u8 = 108u8;
17473 const ENCODED_LEN: usize = 65usize;
17474 fn deser(
17475 _version: MavlinkVersion,
17476 __input: &[u8],
17477 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17478 let avail_len = __input.len();
17479 let mut payload_buf = [0; Self::ENCODED_LEN];
17480 let mut buf = if avail_len < Self::ENCODED_LEN {
17481 payload_buf[0..avail_len].copy_from_slice(__input);
17482 Bytes::new(&payload_buf)
17483 } else {
17484 Bytes::new(__input)
17485 };
17486 let mut __struct = Self::default();
17487 __struct.time_usec = buf.get_u64_le();
17488 __struct.xacc = buf.get_f32_le();
17489 __struct.yacc = buf.get_f32_le();
17490 __struct.zacc = buf.get_f32_le();
17491 __struct.xgyro = buf.get_f32_le();
17492 __struct.ygyro = buf.get_f32_le();
17493 __struct.zgyro = buf.get_f32_le();
17494 __struct.xmag = buf.get_f32_le();
17495 __struct.ymag = buf.get_f32_le();
17496 __struct.zmag = buf.get_f32_le();
17497 __struct.abs_pressure = buf.get_f32_le();
17498 __struct.diff_pressure = buf.get_f32_le();
17499 __struct.pressure_alt = buf.get_f32_le();
17500 __struct.temperature = buf.get_f32_le();
17501 let tmp = buf.get_u32_le();
17502 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
17503 tmp & HilSensorUpdatedFlags::all().bits(),
17504 )
17505 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17506 flag_type: "HilSensorUpdatedFlags",
17507 value: tmp as u32,
17508 })?;
17509 __struct.id = buf.get_u8();
17510 Ok(__struct)
17511 }
17512 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17513 let mut __tmp = BytesMut::new(bytes);
17514 #[allow(clippy::absurd_extreme_comparisons)]
17515 #[allow(unused_comparisons)]
17516 if __tmp.remaining() < Self::ENCODED_LEN {
17517 panic!(
17518 "buffer is too small (need {} bytes, but got {})",
17519 Self::ENCODED_LEN,
17520 __tmp.remaining(),
17521 )
17522 }
17523 __tmp.put_u64_le(self.time_usec);
17524 __tmp.put_f32_le(self.xacc);
17525 __tmp.put_f32_le(self.yacc);
17526 __tmp.put_f32_le(self.zacc);
17527 __tmp.put_f32_le(self.xgyro);
17528 __tmp.put_f32_le(self.ygyro);
17529 __tmp.put_f32_le(self.zgyro);
17530 __tmp.put_f32_le(self.xmag);
17531 __tmp.put_f32_le(self.ymag);
17532 __tmp.put_f32_le(self.zmag);
17533 __tmp.put_f32_le(self.abs_pressure);
17534 __tmp.put_f32_le(self.diff_pressure);
17535 __tmp.put_f32_le(self.pressure_alt);
17536 __tmp.put_f32_le(self.temperature);
17537 __tmp.put_u32_le(self.fields_updated.bits());
17538 if matches!(version, MavlinkVersion::V2) {
17539 __tmp.put_u8(self.id);
17540 let len = __tmp.len();
17541 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17542 } else {
17543 __tmp.len()
17544 }
17545 }
17546}
17547#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
17548#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
17549#[doc = ""]
17550#[doc = "ID: 90"]
17551#[derive(Debug, Clone, PartialEq)]
17552#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17553#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17554#[cfg_attr(feature = "ts", derive(TS))]
17555#[cfg_attr(feature = "ts", ts(export))]
17556pub struct HIL_STATE_DATA {
17557 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17558 pub time_usec: u64,
17559 #[doc = "Roll angle"]
17560 pub roll: f32,
17561 #[doc = "Pitch angle"]
17562 pub pitch: f32,
17563 #[doc = "Yaw angle"]
17564 pub yaw: f32,
17565 #[doc = "Body frame roll / phi angular speed"]
17566 pub rollspeed: f32,
17567 #[doc = "Body frame pitch / theta angular speed"]
17568 pub pitchspeed: f32,
17569 #[doc = "Body frame yaw / psi angular speed"]
17570 pub yawspeed: f32,
17571 #[doc = "Latitude"]
17572 pub lat: i32,
17573 #[doc = "Longitude"]
17574 pub lon: i32,
17575 #[doc = "Altitude"]
17576 pub alt: i32,
17577 #[doc = "Ground X Speed (Latitude)"]
17578 pub vx: i16,
17579 #[doc = "Ground Y Speed (Longitude)"]
17580 pub vy: i16,
17581 #[doc = "Ground Z Speed (Altitude)"]
17582 pub vz: i16,
17583 #[doc = "X acceleration"]
17584 pub xacc: i16,
17585 #[doc = "Y acceleration"]
17586 pub yacc: i16,
17587 #[doc = "Z acceleration"]
17588 pub zacc: i16,
17589}
17590impl HIL_STATE_DATA {
17591 pub const ENCODED_LEN: usize = 56usize;
17592 pub const DEFAULT: Self = Self {
17593 time_usec: 0_u64,
17594 roll: 0.0_f32,
17595 pitch: 0.0_f32,
17596 yaw: 0.0_f32,
17597 rollspeed: 0.0_f32,
17598 pitchspeed: 0.0_f32,
17599 yawspeed: 0.0_f32,
17600 lat: 0_i32,
17601 lon: 0_i32,
17602 alt: 0_i32,
17603 vx: 0_i16,
17604 vy: 0_i16,
17605 vz: 0_i16,
17606 xacc: 0_i16,
17607 yacc: 0_i16,
17608 zacc: 0_i16,
17609 };
17610 #[cfg(feature = "arbitrary")]
17611 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17612 use arbitrary::{Arbitrary, Unstructured};
17613 let mut buf = [0u8; 1024];
17614 rng.fill_bytes(&mut buf);
17615 let mut unstructured = Unstructured::new(&buf);
17616 Self::arbitrary(&mut unstructured).unwrap_or_default()
17617 }
17618}
17619impl Default for HIL_STATE_DATA {
17620 fn default() -> Self {
17621 Self::DEFAULT.clone()
17622 }
17623}
17624impl MessageData for HIL_STATE_DATA {
17625 type Message = MavMessage;
17626 const ID: u32 = 90u32;
17627 const NAME: &'static str = "HIL_STATE";
17628 const EXTRA_CRC: u8 = 183u8;
17629 const ENCODED_LEN: usize = 56usize;
17630 fn deser(
17631 _version: MavlinkVersion,
17632 __input: &[u8],
17633 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17634 let avail_len = __input.len();
17635 let mut payload_buf = [0; Self::ENCODED_LEN];
17636 let mut buf = if avail_len < Self::ENCODED_LEN {
17637 payload_buf[0..avail_len].copy_from_slice(__input);
17638 Bytes::new(&payload_buf)
17639 } else {
17640 Bytes::new(__input)
17641 };
17642 let mut __struct = Self::default();
17643 __struct.time_usec = buf.get_u64_le();
17644 __struct.roll = buf.get_f32_le();
17645 __struct.pitch = buf.get_f32_le();
17646 __struct.yaw = buf.get_f32_le();
17647 __struct.rollspeed = buf.get_f32_le();
17648 __struct.pitchspeed = buf.get_f32_le();
17649 __struct.yawspeed = buf.get_f32_le();
17650 __struct.lat = buf.get_i32_le();
17651 __struct.lon = buf.get_i32_le();
17652 __struct.alt = buf.get_i32_le();
17653 __struct.vx = buf.get_i16_le();
17654 __struct.vy = buf.get_i16_le();
17655 __struct.vz = buf.get_i16_le();
17656 __struct.xacc = buf.get_i16_le();
17657 __struct.yacc = buf.get_i16_le();
17658 __struct.zacc = buf.get_i16_le();
17659 Ok(__struct)
17660 }
17661 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17662 let mut __tmp = BytesMut::new(bytes);
17663 #[allow(clippy::absurd_extreme_comparisons)]
17664 #[allow(unused_comparisons)]
17665 if __tmp.remaining() < Self::ENCODED_LEN {
17666 panic!(
17667 "buffer is too small (need {} bytes, but got {})",
17668 Self::ENCODED_LEN,
17669 __tmp.remaining(),
17670 )
17671 }
17672 __tmp.put_u64_le(self.time_usec);
17673 __tmp.put_f32_le(self.roll);
17674 __tmp.put_f32_le(self.pitch);
17675 __tmp.put_f32_le(self.yaw);
17676 __tmp.put_f32_le(self.rollspeed);
17677 __tmp.put_f32_le(self.pitchspeed);
17678 __tmp.put_f32_le(self.yawspeed);
17679 __tmp.put_i32_le(self.lat);
17680 __tmp.put_i32_le(self.lon);
17681 __tmp.put_i32_le(self.alt);
17682 __tmp.put_i16_le(self.vx);
17683 __tmp.put_i16_le(self.vy);
17684 __tmp.put_i16_le(self.vz);
17685 __tmp.put_i16_le(self.xacc);
17686 __tmp.put_i16_le(self.yacc);
17687 __tmp.put_i16_le(self.zacc);
17688 if matches!(version, MavlinkVersion::V2) {
17689 let len = __tmp.len();
17690 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17691 } else {
17692 __tmp.len()
17693 }
17694 }
17695}
17696#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
17697#[doc = ""]
17698#[doc = "ID: 115"]
17699#[derive(Debug, Clone, PartialEq)]
17700#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17701#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17702#[cfg_attr(feature = "ts", derive(TS))]
17703#[cfg_attr(feature = "ts", ts(export))]
17704pub struct HIL_STATE_QUATERNION_DATA {
17705 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17706 pub time_usec: u64,
17707 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
17708 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17709 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17710 pub attitude_quaternion: [f32; 4],
17711 #[doc = "Body frame roll / phi angular speed"]
17712 pub rollspeed: f32,
17713 #[doc = "Body frame pitch / theta angular speed"]
17714 pub pitchspeed: f32,
17715 #[doc = "Body frame yaw / psi angular speed"]
17716 pub yawspeed: f32,
17717 #[doc = "Latitude"]
17718 pub lat: i32,
17719 #[doc = "Longitude"]
17720 pub lon: i32,
17721 #[doc = "Altitude"]
17722 pub alt: i32,
17723 #[doc = "Ground X Speed (Latitude)"]
17724 pub vx: i16,
17725 #[doc = "Ground Y Speed (Longitude)"]
17726 pub vy: i16,
17727 #[doc = "Ground Z Speed (Altitude)"]
17728 pub vz: i16,
17729 #[doc = "Indicated airspeed"]
17730 pub ind_airspeed: u16,
17731 #[doc = "True airspeed"]
17732 pub true_airspeed: u16,
17733 #[doc = "X acceleration"]
17734 pub xacc: i16,
17735 #[doc = "Y acceleration"]
17736 pub yacc: i16,
17737 #[doc = "Z acceleration"]
17738 pub zacc: i16,
17739}
17740impl HIL_STATE_QUATERNION_DATA {
17741 pub const ENCODED_LEN: usize = 64usize;
17742 pub const DEFAULT: Self = Self {
17743 time_usec: 0_u64,
17744 attitude_quaternion: [0.0_f32; 4usize],
17745 rollspeed: 0.0_f32,
17746 pitchspeed: 0.0_f32,
17747 yawspeed: 0.0_f32,
17748 lat: 0_i32,
17749 lon: 0_i32,
17750 alt: 0_i32,
17751 vx: 0_i16,
17752 vy: 0_i16,
17753 vz: 0_i16,
17754 ind_airspeed: 0_u16,
17755 true_airspeed: 0_u16,
17756 xacc: 0_i16,
17757 yacc: 0_i16,
17758 zacc: 0_i16,
17759 };
17760 #[cfg(feature = "arbitrary")]
17761 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17762 use arbitrary::{Arbitrary, Unstructured};
17763 let mut buf = [0u8; 1024];
17764 rng.fill_bytes(&mut buf);
17765 let mut unstructured = Unstructured::new(&buf);
17766 Self::arbitrary(&mut unstructured).unwrap_or_default()
17767 }
17768}
17769impl Default for HIL_STATE_QUATERNION_DATA {
17770 fn default() -> Self {
17771 Self::DEFAULT.clone()
17772 }
17773}
17774impl MessageData for HIL_STATE_QUATERNION_DATA {
17775 type Message = MavMessage;
17776 const ID: u32 = 115u32;
17777 const NAME: &'static str = "HIL_STATE_QUATERNION";
17778 const EXTRA_CRC: u8 = 4u8;
17779 const ENCODED_LEN: usize = 64usize;
17780 fn deser(
17781 _version: MavlinkVersion,
17782 __input: &[u8],
17783 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17784 let avail_len = __input.len();
17785 let mut payload_buf = [0; Self::ENCODED_LEN];
17786 let mut buf = if avail_len < Self::ENCODED_LEN {
17787 payload_buf[0..avail_len].copy_from_slice(__input);
17788 Bytes::new(&payload_buf)
17789 } else {
17790 Bytes::new(__input)
17791 };
17792 let mut __struct = Self::default();
17793 __struct.time_usec = buf.get_u64_le();
17794 for v in &mut __struct.attitude_quaternion {
17795 let val = buf.get_f32_le();
17796 *v = val;
17797 }
17798 __struct.rollspeed = buf.get_f32_le();
17799 __struct.pitchspeed = buf.get_f32_le();
17800 __struct.yawspeed = buf.get_f32_le();
17801 __struct.lat = buf.get_i32_le();
17802 __struct.lon = buf.get_i32_le();
17803 __struct.alt = buf.get_i32_le();
17804 __struct.vx = buf.get_i16_le();
17805 __struct.vy = buf.get_i16_le();
17806 __struct.vz = buf.get_i16_le();
17807 __struct.ind_airspeed = buf.get_u16_le();
17808 __struct.true_airspeed = buf.get_u16_le();
17809 __struct.xacc = buf.get_i16_le();
17810 __struct.yacc = buf.get_i16_le();
17811 __struct.zacc = buf.get_i16_le();
17812 Ok(__struct)
17813 }
17814 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17815 let mut __tmp = BytesMut::new(bytes);
17816 #[allow(clippy::absurd_extreme_comparisons)]
17817 #[allow(unused_comparisons)]
17818 if __tmp.remaining() < Self::ENCODED_LEN {
17819 panic!(
17820 "buffer is too small (need {} bytes, but got {})",
17821 Self::ENCODED_LEN,
17822 __tmp.remaining(),
17823 )
17824 }
17825 __tmp.put_u64_le(self.time_usec);
17826 for val in &self.attitude_quaternion {
17827 __tmp.put_f32_le(*val);
17828 }
17829 __tmp.put_f32_le(self.rollspeed);
17830 __tmp.put_f32_le(self.pitchspeed);
17831 __tmp.put_f32_le(self.yawspeed);
17832 __tmp.put_i32_le(self.lat);
17833 __tmp.put_i32_le(self.lon);
17834 __tmp.put_i32_le(self.alt);
17835 __tmp.put_i16_le(self.vx);
17836 __tmp.put_i16_le(self.vy);
17837 __tmp.put_i16_le(self.vz);
17838 __tmp.put_u16_le(self.ind_airspeed);
17839 __tmp.put_u16_le(self.true_airspeed);
17840 __tmp.put_i16_le(self.xacc);
17841 __tmp.put_i16_le(self.yacc);
17842 __tmp.put_i16_le(self.zacc);
17843 if matches!(version, MavlinkVersion::V2) {
17844 let len = __tmp.len();
17845 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17846 } else {
17847 __tmp.len()
17848 }
17849 }
17850}
17851#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
17852#[doc = ""]
17853#[doc = "ID: 242"]
17854#[derive(Debug, Clone, PartialEq)]
17855#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17856#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17857#[cfg_attr(feature = "ts", derive(TS))]
17858#[cfg_attr(feature = "ts", ts(export))]
17859pub struct HOME_POSITION_DATA {
17860 #[doc = "Latitude (WGS84)"]
17861 pub latitude: i32,
17862 #[doc = "Longitude (WGS84)"]
17863 pub longitude: i32,
17864 #[doc = "Altitude (MSL). Positive for up."]
17865 pub altitude: i32,
17866 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
17867 pub x: f32,
17868 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
17869 pub y: f32,
17870 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
17871 pub z: f32,
17872 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
17873 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17874 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17875 pub q: [f32; 4],
17876 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17877 pub approach_x: f32,
17878 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17879 pub approach_y: f32,
17880 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17881 pub approach_z: f32,
17882 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17883 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17884 pub time_usec: u64,
17885}
17886impl HOME_POSITION_DATA {
17887 pub const ENCODED_LEN: usize = 60usize;
17888 pub const DEFAULT: Self = Self {
17889 latitude: 0_i32,
17890 longitude: 0_i32,
17891 altitude: 0_i32,
17892 x: 0.0_f32,
17893 y: 0.0_f32,
17894 z: 0.0_f32,
17895 q: [0.0_f32; 4usize],
17896 approach_x: 0.0_f32,
17897 approach_y: 0.0_f32,
17898 approach_z: 0.0_f32,
17899 time_usec: 0_u64,
17900 };
17901 #[cfg(feature = "arbitrary")]
17902 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17903 use arbitrary::{Arbitrary, Unstructured};
17904 let mut buf = [0u8; 1024];
17905 rng.fill_bytes(&mut buf);
17906 let mut unstructured = Unstructured::new(&buf);
17907 Self::arbitrary(&mut unstructured).unwrap_or_default()
17908 }
17909}
17910impl Default for HOME_POSITION_DATA {
17911 fn default() -> Self {
17912 Self::DEFAULT.clone()
17913 }
17914}
17915impl MessageData for HOME_POSITION_DATA {
17916 type Message = MavMessage;
17917 const ID: u32 = 242u32;
17918 const NAME: &'static str = "HOME_POSITION";
17919 const EXTRA_CRC: u8 = 104u8;
17920 const ENCODED_LEN: usize = 60usize;
17921 fn deser(
17922 _version: MavlinkVersion,
17923 __input: &[u8],
17924 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17925 let avail_len = __input.len();
17926 let mut payload_buf = [0; Self::ENCODED_LEN];
17927 let mut buf = if avail_len < Self::ENCODED_LEN {
17928 payload_buf[0..avail_len].copy_from_slice(__input);
17929 Bytes::new(&payload_buf)
17930 } else {
17931 Bytes::new(__input)
17932 };
17933 let mut __struct = Self::default();
17934 __struct.latitude = buf.get_i32_le();
17935 __struct.longitude = buf.get_i32_le();
17936 __struct.altitude = buf.get_i32_le();
17937 __struct.x = buf.get_f32_le();
17938 __struct.y = buf.get_f32_le();
17939 __struct.z = buf.get_f32_le();
17940 for v in &mut __struct.q {
17941 let val = buf.get_f32_le();
17942 *v = val;
17943 }
17944 __struct.approach_x = buf.get_f32_le();
17945 __struct.approach_y = buf.get_f32_le();
17946 __struct.approach_z = buf.get_f32_le();
17947 __struct.time_usec = buf.get_u64_le();
17948 Ok(__struct)
17949 }
17950 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17951 let mut __tmp = BytesMut::new(bytes);
17952 #[allow(clippy::absurd_extreme_comparisons)]
17953 #[allow(unused_comparisons)]
17954 if __tmp.remaining() < Self::ENCODED_LEN {
17955 panic!(
17956 "buffer is too small (need {} bytes, but got {})",
17957 Self::ENCODED_LEN,
17958 __tmp.remaining(),
17959 )
17960 }
17961 __tmp.put_i32_le(self.latitude);
17962 __tmp.put_i32_le(self.longitude);
17963 __tmp.put_i32_le(self.altitude);
17964 __tmp.put_f32_le(self.x);
17965 __tmp.put_f32_le(self.y);
17966 __tmp.put_f32_le(self.z);
17967 for val in &self.q {
17968 __tmp.put_f32_le(*val);
17969 }
17970 __tmp.put_f32_le(self.approach_x);
17971 __tmp.put_f32_le(self.approach_y);
17972 __tmp.put_f32_le(self.approach_z);
17973 if matches!(version, MavlinkVersion::V2) {
17974 __tmp.put_u64_le(self.time_usec);
17975 let len = __tmp.len();
17976 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17977 } else {
17978 __tmp.len()
17979 }
17980 }
17981}
17982#[doc = "Temperature and humidity from hygrometer."]
17983#[doc = ""]
17984#[doc = "ID: 12920"]
17985#[derive(Debug, Clone, PartialEq)]
17986#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17987#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17988#[cfg_attr(feature = "ts", derive(TS))]
17989#[cfg_attr(feature = "ts", ts(export))]
17990pub struct HYGROMETER_SENSOR_DATA {
17991 #[doc = "Temperature"]
17992 pub temperature: i16,
17993 #[doc = "Humidity"]
17994 pub humidity: u16,
17995 #[doc = "Hygrometer ID"]
17996 pub id: u8,
17997}
17998impl HYGROMETER_SENSOR_DATA {
17999 pub const ENCODED_LEN: usize = 5usize;
18000 pub const DEFAULT: Self = Self {
18001 temperature: 0_i16,
18002 humidity: 0_u16,
18003 id: 0_u8,
18004 };
18005 #[cfg(feature = "arbitrary")]
18006 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18007 use arbitrary::{Arbitrary, Unstructured};
18008 let mut buf = [0u8; 1024];
18009 rng.fill_bytes(&mut buf);
18010 let mut unstructured = Unstructured::new(&buf);
18011 Self::arbitrary(&mut unstructured).unwrap_or_default()
18012 }
18013}
18014impl Default for HYGROMETER_SENSOR_DATA {
18015 fn default() -> Self {
18016 Self::DEFAULT.clone()
18017 }
18018}
18019impl MessageData for HYGROMETER_SENSOR_DATA {
18020 type Message = MavMessage;
18021 const ID: u32 = 12920u32;
18022 const NAME: &'static str = "HYGROMETER_SENSOR";
18023 const EXTRA_CRC: u8 = 20u8;
18024 const ENCODED_LEN: usize = 5usize;
18025 fn deser(
18026 _version: MavlinkVersion,
18027 __input: &[u8],
18028 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18029 let avail_len = __input.len();
18030 let mut payload_buf = [0; Self::ENCODED_LEN];
18031 let mut buf = if avail_len < Self::ENCODED_LEN {
18032 payload_buf[0..avail_len].copy_from_slice(__input);
18033 Bytes::new(&payload_buf)
18034 } else {
18035 Bytes::new(__input)
18036 };
18037 let mut __struct = Self::default();
18038 __struct.temperature = buf.get_i16_le();
18039 __struct.humidity = buf.get_u16_le();
18040 __struct.id = buf.get_u8();
18041 Ok(__struct)
18042 }
18043 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18044 let mut __tmp = BytesMut::new(bytes);
18045 #[allow(clippy::absurd_extreme_comparisons)]
18046 #[allow(unused_comparisons)]
18047 if __tmp.remaining() < Self::ENCODED_LEN {
18048 panic!(
18049 "buffer is too small (need {} bytes, but got {})",
18050 Self::ENCODED_LEN,
18051 __tmp.remaining(),
18052 )
18053 }
18054 __tmp.put_i16_le(self.temperature);
18055 __tmp.put_u16_le(self.humidity);
18056 __tmp.put_u8(self.id);
18057 if matches!(version, MavlinkVersion::V2) {
18058 let len = __tmp.len();
18059 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18060 } else {
18061 __tmp.len()
18062 }
18063 }
18064}
18065#[doc = "Illuminator status."]
18066#[doc = ""]
18067#[doc = "ID: 440"]
18068#[derive(Debug, Clone, PartialEq)]
18069#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18070#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18071#[cfg_attr(feature = "ts", derive(TS))]
18072#[cfg_attr(feature = "ts", ts(export))]
18073pub struct ILLUMINATOR_STATUS_DATA {
18074 #[doc = "Time since the start-up of the illuminator in ms"]
18075 pub uptime_ms: u32,
18076 #[doc = "Errors"]
18077 pub error_status: IlluminatorErrorFlags,
18078 #[doc = "Illuminator brightness"]
18079 pub brightness: f32,
18080 #[doc = "Illuminator strobing period in seconds"]
18081 pub strobe_period: f32,
18082 #[doc = "Illuminator strobing duty cycle"]
18083 pub strobe_duty_cycle: f32,
18084 #[doc = "Temperature in Celsius"]
18085 pub temp_c: f32,
18086 #[doc = "Minimum strobing period in seconds"]
18087 pub min_strobe_period: f32,
18088 #[doc = "Maximum strobing period in seconds"]
18089 pub max_strobe_period: f32,
18090 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
18091 pub enable: u8,
18092 #[doc = "Supported illuminator modes"]
18093 pub mode_bitmask: IlluminatorMode,
18094 #[doc = "Illuminator mode"]
18095 pub mode: IlluminatorMode,
18096}
18097impl ILLUMINATOR_STATUS_DATA {
18098 pub const ENCODED_LEN: usize = 35usize;
18099 pub const DEFAULT: Self = Self {
18100 uptime_ms: 0_u32,
18101 error_status: IlluminatorErrorFlags::DEFAULT,
18102 brightness: 0.0_f32,
18103 strobe_period: 0.0_f32,
18104 strobe_duty_cycle: 0.0_f32,
18105 temp_c: 0.0_f32,
18106 min_strobe_period: 0.0_f32,
18107 max_strobe_period: 0.0_f32,
18108 enable: 0_u8,
18109 mode_bitmask: IlluminatorMode::DEFAULT,
18110 mode: IlluminatorMode::DEFAULT,
18111 };
18112 #[cfg(feature = "arbitrary")]
18113 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18114 use arbitrary::{Arbitrary, Unstructured};
18115 let mut buf = [0u8; 1024];
18116 rng.fill_bytes(&mut buf);
18117 let mut unstructured = Unstructured::new(&buf);
18118 Self::arbitrary(&mut unstructured).unwrap_or_default()
18119 }
18120}
18121impl Default for ILLUMINATOR_STATUS_DATA {
18122 fn default() -> Self {
18123 Self::DEFAULT.clone()
18124 }
18125}
18126impl MessageData for ILLUMINATOR_STATUS_DATA {
18127 type Message = MavMessage;
18128 const ID: u32 = 440u32;
18129 const NAME: &'static str = "ILLUMINATOR_STATUS";
18130 const EXTRA_CRC: u8 = 66u8;
18131 const ENCODED_LEN: usize = 35usize;
18132 fn deser(
18133 _version: MavlinkVersion,
18134 __input: &[u8],
18135 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18136 let avail_len = __input.len();
18137 let mut payload_buf = [0; Self::ENCODED_LEN];
18138 let mut buf = if avail_len < Self::ENCODED_LEN {
18139 payload_buf[0..avail_len].copy_from_slice(__input);
18140 Bytes::new(&payload_buf)
18141 } else {
18142 Bytes::new(__input)
18143 };
18144 let mut __struct = Self::default();
18145 __struct.uptime_ms = buf.get_u32_le();
18146 let tmp = buf.get_u32_le();
18147 __struct.error_status = IlluminatorErrorFlags::from_bits(
18148 tmp & IlluminatorErrorFlags::all().bits(),
18149 )
18150 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
18151 flag_type: "IlluminatorErrorFlags",
18152 value: tmp as u32,
18153 })?;
18154 __struct.brightness = buf.get_f32_le();
18155 __struct.strobe_period = buf.get_f32_le();
18156 __struct.strobe_duty_cycle = buf.get_f32_le();
18157 __struct.temp_c = buf.get_f32_le();
18158 __struct.min_strobe_period = buf.get_f32_le();
18159 __struct.max_strobe_period = buf.get_f32_le();
18160 __struct.enable = buf.get_u8();
18161 let tmp = buf.get_u8();
18162 __struct.mode_bitmask =
18163 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18164 enum_type: "IlluminatorMode",
18165 value: tmp as u32,
18166 })?;
18167 let tmp = buf.get_u8();
18168 __struct.mode =
18169 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18170 enum_type: "IlluminatorMode",
18171 value: tmp as u32,
18172 })?;
18173 Ok(__struct)
18174 }
18175 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18176 let mut __tmp = BytesMut::new(bytes);
18177 #[allow(clippy::absurd_extreme_comparisons)]
18178 #[allow(unused_comparisons)]
18179 if __tmp.remaining() < Self::ENCODED_LEN {
18180 panic!(
18181 "buffer is too small (need {} bytes, but got {})",
18182 Self::ENCODED_LEN,
18183 __tmp.remaining(),
18184 )
18185 }
18186 __tmp.put_u32_le(self.uptime_ms);
18187 __tmp.put_u32_le(self.error_status.bits());
18188 __tmp.put_f32_le(self.brightness);
18189 __tmp.put_f32_le(self.strobe_period);
18190 __tmp.put_f32_le(self.strobe_duty_cycle);
18191 __tmp.put_f32_le(self.temp_c);
18192 __tmp.put_f32_le(self.min_strobe_period);
18193 __tmp.put_f32_le(self.max_strobe_period);
18194 __tmp.put_u8(self.enable);
18195 __tmp.put_u8(self.mode_bitmask as u8);
18196 __tmp.put_u8(self.mode as u8);
18197 if matches!(version, MavlinkVersion::V2) {
18198 let len = __tmp.len();
18199 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18200 } else {
18201 __tmp.len()
18202 }
18203 }
18204}
18205#[doc = "Status of the Iridium SBD link."]
18206#[doc = ""]
18207#[doc = "ID: 335"]
18208#[derive(Debug, Clone, PartialEq)]
18209#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18211#[cfg_attr(feature = "ts", derive(TS))]
18212#[cfg_attr(feature = "ts", ts(export))]
18213pub struct ISBD_LINK_STATUS_DATA {
18214 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18215 pub timestamp: u64,
18216 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18217 pub last_heartbeat: u64,
18218 #[doc = "Number of failed SBD sessions."]
18219 pub failed_sessions: u16,
18220 #[doc = "Number of successful SBD sessions."]
18221 pub successful_sessions: u16,
18222 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
18223 pub signal_quality: u8,
18224 #[doc = "1: Ring call pending, 0: No call pending."]
18225 pub ring_pending: u8,
18226 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
18227 pub tx_session_pending: u8,
18228 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
18229 pub rx_session_pending: u8,
18230}
18231impl ISBD_LINK_STATUS_DATA {
18232 pub const ENCODED_LEN: usize = 24usize;
18233 pub const DEFAULT: Self = Self {
18234 timestamp: 0_u64,
18235 last_heartbeat: 0_u64,
18236 failed_sessions: 0_u16,
18237 successful_sessions: 0_u16,
18238 signal_quality: 0_u8,
18239 ring_pending: 0_u8,
18240 tx_session_pending: 0_u8,
18241 rx_session_pending: 0_u8,
18242 };
18243 #[cfg(feature = "arbitrary")]
18244 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18245 use arbitrary::{Arbitrary, Unstructured};
18246 let mut buf = [0u8; 1024];
18247 rng.fill_bytes(&mut buf);
18248 let mut unstructured = Unstructured::new(&buf);
18249 Self::arbitrary(&mut unstructured).unwrap_or_default()
18250 }
18251}
18252impl Default for ISBD_LINK_STATUS_DATA {
18253 fn default() -> Self {
18254 Self::DEFAULT.clone()
18255 }
18256}
18257impl MessageData for ISBD_LINK_STATUS_DATA {
18258 type Message = MavMessage;
18259 const ID: u32 = 335u32;
18260 const NAME: &'static str = "ISBD_LINK_STATUS";
18261 const EXTRA_CRC: u8 = 225u8;
18262 const ENCODED_LEN: usize = 24usize;
18263 fn deser(
18264 _version: MavlinkVersion,
18265 __input: &[u8],
18266 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18267 let avail_len = __input.len();
18268 let mut payload_buf = [0; Self::ENCODED_LEN];
18269 let mut buf = if avail_len < Self::ENCODED_LEN {
18270 payload_buf[0..avail_len].copy_from_slice(__input);
18271 Bytes::new(&payload_buf)
18272 } else {
18273 Bytes::new(__input)
18274 };
18275 let mut __struct = Self::default();
18276 __struct.timestamp = buf.get_u64_le();
18277 __struct.last_heartbeat = buf.get_u64_le();
18278 __struct.failed_sessions = buf.get_u16_le();
18279 __struct.successful_sessions = buf.get_u16_le();
18280 __struct.signal_quality = buf.get_u8();
18281 __struct.ring_pending = buf.get_u8();
18282 __struct.tx_session_pending = buf.get_u8();
18283 __struct.rx_session_pending = buf.get_u8();
18284 Ok(__struct)
18285 }
18286 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18287 let mut __tmp = BytesMut::new(bytes);
18288 #[allow(clippy::absurd_extreme_comparisons)]
18289 #[allow(unused_comparisons)]
18290 if __tmp.remaining() < Self::ENCODED_LEN {
18291 panic!(
18292 "buffer is too small (need {} bytes, but got {})",
18293 Self::ENCODED_LEN,
18294 __tmp.remaining(),
18295 )
18296 }
18297 __tmp.put_u64_le(self.timestamp);
18298 __tmp.put_u64_le(self.last_heartbeat);
18299 __tmp.put_u16_le(self.failed_sessions);
18300 __tmp.put_u16_le(self.successful_sessions);
18301 __tmp.put_u8(self.signal_quality);
18302 __tmp.put_u8(self.ring_pending);
18303 __tmp.put_u8(self.tx_session_pending);
18304 __tmp.put_u8(self.rx_session_pending);
18305 if matches!(version, MavlinkVersion::V2) {
18306 let len = __tmp.len();
18307 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18308 } else {
18309 __tmp.len()
18310 }
18311 }
18312}
18313#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
18314#[doc = ""]
18315#[doc = "ID: 149"]
18316#[derive(Debug, Clone, PartialEq)]
18317#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18319#[cfg_attr(feature = "ts", derive(TS))]
18320#[cfg_attr(feature = "ts", ts(export))]
18321pub struct LANDING_TARGET_DATA {
18322 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18323 pub time_usec: u64,
18324 #[doc = "X-axis angular offset of the target from the center of the image"]
18325 pub angle_x: f32,
18326 #[doc = "Y-axis angular offset of the target from the center of the image"]
18327 pub angle_y: f32,
18328 #[doc = "Distance to the target from the vehicle"]
18329 pub distance: f32,
18330 #[doc = "Size of target along x-axis"]
18331 pub size_x: f32,
18332 #[doc = "Size of target along y-axis"]
18333 pub size_y: f32,
18334 #[doc = "The ID of the target if multiple targets are present"]
18335 pub target_num: u8,
18336 #[doc = "Coordinate frame used for following fields."]
18337 pub frame: MavFrame,
18338 #[doc = "X Position of the landing target in MAV_FRAME"]
18339 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18340 pub x: f32,
18341 #[doc = "Y Position of the landing target in MAV_FRAME"]
18342 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18343 pub y: f32,
18344 #[doc = "Z Position of the landing target in MAV_FRAME"]
18345 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18346 pub z: f32,
18347 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
18348 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18349 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18350 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18351 pub q: [f32; 4],
18352 #[doc = "Type of landing target"]
18353 #[cfg_attr(feature = "serde", serde(default))]
18354 pub mavtype: LandingTargetType,
18355 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
18356 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18357 pub position_valid: u8,
18358}
18359impl LANDING_TARGET_DATA {
18360 pub const ENCODED_LEN: usize = 60usize;
18361 pub const DEFAULT: Self = Self {
18362 time_usec: 0_u64,
18363 angle_x: 0.0_f32,
18364 angle_y: 0.0_f32,
18365 distance: 0.0_f32,
18366 size_x: 0.0_f32,
18367 size_y: 0.0_f32,
18368 target_num: 0_u8,
18369 frame: MavFrame::DEFAULT,
18370 x: 0.0_f32,
18371 y: 0.0_f32,
18372 z: 0.0_f32,
18373 q: [0.0_f32; 4usize],
18374 mavtype: LandingTargetType::DEFAULT,
18375 position_valid: 0_u8,
18376 };
18377 #[cfg(feature = "arbitrary")]
18378 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18379 use arbitrary::{Arbitrary, Unstructured};
18380 let mut buf = [0u8; 1024];
18381 rng.fill_bytes(&mut buf);
18382 let mut unstructured = Unstructured::new(&buf);
18383 Self::arbitrary(&mut unstructured).unwrap_or_default()
18384 }
18385}
18386impl Default for LANDING_TARGET_DATA {
18387 fn default() -> Self {
18388 Self::DEFAULT.clone()
18389 }
18390}
18391impl MessageData for LANDING_TARGET_DATA {
18392 type Message = MavMessage;
18393 const ID: u32 = 149u32;
18394 const NAME: &'static str = "LANDING_TARGET";
18395 const EXTRA_CRC: u8 = 200u8;
18396 const ENCODED_LEN: usize = 60usize;
18397 fn deser(
18398 _version: MavlinkVersion,
18399 __input: &[u8],
18400 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18401 let avail_len = __input.len();
18402 let mut payload_buf = [0; Self::ENCODED_LEN];
18403 let mut buf = if avail_len < Self::ENCODED_LEN {
18404 payload_buf[0..avail_len].copy_from_slice(__input);
18405 Bytes::new(&payload_buf)
18406 } else {
18407 Bytes::new(__input)
18408 };
18409 let mut __struct = Self::default();
18410 __struct.time_usec = buf.get_u64_le();
18411 __struct.angle_x = buf.get_f32_le();
18412 __struct.angle_y = buf.get_f32_le();
18413 __struct.distance = buf.get_f32_le();
18414 __struct.size_x = buf.get_f32_le();
18415 __struct.size_y = buf.get_f32_le();
18416 __struct.target_num = buf.get_u8();
18417 let tmp = buf.get_u8();
18418 __struct.frame =
18419 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18420 enum_type: "MavFrame",
18421 value: tmp as u32,
18422 })?;
18423 __struct.x = buf.get_f32_le();
18424 __struct.y = buf.get_f32_le();
18425 __struct.z = buf.get_f32_le();
18426 for v in &mut __struct.q {
18427 let val = buf.get_f32_le();
18428 *v = val;
18429 }
18430 let tmp = buf.get_u8();
18431 __struct.mavtype =
18432 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18433 enum_type: "LandingTargetType",
18434 value: tmp as u32,
18435 })?;
18436 __struct.position_valid = buf.get_u8();
18437 Ok(__struct)
18438 }
18439 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18440 let mut __tmp = BytesMut::new(bytes);
18441 #[allow(clippy::absurd_extreme_comparisons)]
18442 #[allow(unused_comparisons)]
18443 if __tmp.remaining() < Self::ENCODED_LEN {
18444 panic!(
18445 "buffer is too small (need {} bytes, but got {})",
18446 Self::ENCODED_LEN,
18447 __tmp.remaining(),
18448 )
18449 }
18450 __tmp.put_u64_le(self.time_usec);
18451 __tmp.put_f32_le(self.angle_x);
18452 __tmp.put_f32_le(self.angle_y);
18453 __tmp.put_f32_le(self.distance);
18454 __tmp.put_f32_le(self.size_x);
18455 __tmp.put_f32_le(self.size_y);
18456 __tmp.put_u8(self.target_num);
18457 __tmp.put_u8(self.frame as u8);
18458 if matches!(version, MavlinkVersion::V2) {
18459 __tmp.put_f32_le(self.x);
18460 __tmp.put_f32_le(self.y);
18461 __tmp.put_f32_le(self.z);
18462 for val in &self.q {
18463 __tmp.put_f32_le(*val);
18464 }
18465 __tmp.put_u8(self.mavtype as u8);
18466 __tmp.put_u8(self.position_valid);
18467 let len = __tmp.len();
18468 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18469 } else {
18470 __tmp.len()
18471 }
18472 }
18473}
18474#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
18475#[doc = ""]
18476#[doc = "ID: 8"]
18477#[derive(Debug, Clone, PartialEq)]
18478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18479#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18480#[cfg_attr(feature = "ts", derive(TS))]
18481#[cfg_attr(feature = "ts", ts(export))]
18482pub struct LINK_NODE_STATUS_DATA {
18483 #[doc = "Timestamp (time since system boot)."]
18484 pub timestamp: u64,
18485 #[doc = "Transmit rate"]
18486 pub tx_rate: u32,
18487 #[doc = "Receive rate"]
18488 pub rx_rate: u32,
18489 #[doc = "Messages sent"]
18490 pub messages_sent: u32,
18491 #[doc = "Messages received (estimated from counting seq)"]
18492 pub messages_received: u32,
18493 #[doc = "Messages lost (estimated from counting seq)"]
18494 pub messages_lost: u32,
18495 #[doc = "Number of bytes that could not be parsed correctly."]
18496 pub rx_parse_err: u16,
18497 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
18498 pub tx_overflows: u16,
18499 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
18500 pub rx_overflows: u16,
18501 #[doc = "Remaining free transmit buffer space"]
18502 pub tx_buf: u8,
18503 #[doc = "Remaining free receive buffer space"]
18504 pub rx_buf: u8,
18505}
18506impl LINK_NODE_STATUS_DATA {
18507 pub const ENCODED_LEN: usize = 36usize;
18508 pub const DEFAULT: Self = Self {
18509 timestamp: 0_u64,
18510 tx_rate: 0_u32,
18511 rx_rate: 0_u32,
18512 messages_sent: 0_u32,
18513 messages_received: 0_u32,
18514 messages_lost: 0_u32,
18515 rx_parse_err: 0_u16,
18516 tx_overflows: 0_u16,
18517 rx_overflows: 0_u16,
18518 tx_buf: 0_u8,
18519 rx_buf: 0_u8,
18520 };
18521 #[cfg(feature = "arbitrary")]
18522 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18523 use arbitrary::{Arbitrary, Unstructured};
18524 let mut buf = [0u8; 1024];
18525 rng.fill_bytes(&mut buf);
18526 let mut unstructured = Unstructured::new(&buf);
18527 Self::arbitrary(&mut unstructured).unwrap_or_default()
18528 }
18529}
18530impl Default for LINK_NODE_STATUS_DATA {
18531 fn default() -> Self {
18532 Self::DEFAULT.clone()
18533 }
18534}
18535impl MessageData for LINK_NODE_STATUS_DATA {
18536 type Message = MavMessage;
18537 const ID: u32 = 8u32;
18538 const NAME: &'static str = "LINK_NODE_STATUS";
18539 const EXTRA_CRC: u8 = 117u8;
18540 const ENCODED_LEN: usize = 36usize;
18541 fn deser(
18542 _version: MavlinkVersion,
18543 __input: &[u8],
18544 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18545 let avail_len = __input.len();
18546 let mut payload_buf = [0; Self::ENCODED_LEN];
18547 let mut buf = if avail_len < Self::ENCODED_LEN {
18548 payload_buf[0..avail_len].copy_from_slice(__input);
18549 Bytes::new(&payload_buf)
18550 } else {
18551 Bytes::new(__input)
18552 };
18553 let mut __struct = Self::default();
18554 __struct.timestamp = buf.get_u64_le();
18555 __struct.tx_rate = buf.get_u32_le();
18556 __struct.rx_rate = buf.get_u32_le();
18557 __struct.messages_sent = buf.get_u32_le();
18558 __struct.messages_received = buf.get_u32_le();
18559 __struct.messages_lost = buf.get_u32_le();
18560 __struct.rx_parse_err = buf.get_u16_le();
18561 __struct.tx_overflows = buf.get_u16_le();
18562 __struct.rx_overflows = buf.get_u16_le();
18563 __struct.tx_buf = buf.get_u8();
18564 __struct.rx_buf = buf.get_u8();
18565 Ok(__struct)
18566 }
18567 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18568 let mut __tmp = BytesMut::new(bytes);
18569 #[allow(clippy::absurd_extreme_comparisons)]
18570 #[allow(unused_comparisons)]
18571 if __tmp.remaining() < Self::ENCODED_LEN {
18572 panic!(
18573 "buffer is too small (need {} bytes, but got {})",
18574 Self::ENCODED_LEN,
18575 __tmp.remaining(),
18576 )
18577 }
18578 __tmp.put_u64_le(self.timestamp);
18579 __tmp.put_u32_le(self.tx_rate);
18580 __tmp.put_u32_le(self.rx_rate);
18581 __tmp.put_u32_le(self.messages_sent);
18582 __tmp.put_u32_le(self.messages_received);
18583 __tmp.put_u32_le(self.messages_lost);
18584 __tmp.put_u16_le(self.rx_parse_err);
18585 __tmp.put_u16_le(self.tx_overflows);
18586 __tmp.put_u16_le(self.rx_overflows);
18587 __tmp.put_u8(self.tx_buf);
18588 __tmp.put_u8(self.rx_buf);
18589 if matches!(version, MavlinkVersion::V2) {
18590 let len = __tmp.len();
18591 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18592 } else {
18593 __tmp.len()
18594 }
18595 }
18596}
18597#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18598#[doc = ""]
18599#[doc = "ID: 32"]
18600#[derive(Debug, Clone, PartialEq)]
18601#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18602#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18603#[cfg_attr(feature = "ts", derive(TS))]
18604#[cfg_attr(feature = "ts", ts(export))]
18605pub struct LOCAL_POSITION_NED_DATA {
18606 #[doc = "Timestamp (time since system boot)."]
18607 pub time_boot_ms: u32,
18608 #[doc = "X Position"]
18609 pub x: f32,
18610 #[doc = "Y Position"]
18611 pub y: f32,
18612 #[doc = "Z Position"]
18613 pub z: f32,
18614 #[doc = "X Speed"]
18615 pub vx: f32,
18616 #[doc = "Y Speed"]
18617 pub vy: f32,
18618 #[doc = "Z Speed"]
18619 pub vz: f32,
18620}
18621impl LOCAL_POSITION_NED_DATA {
18622 pub const ENCODED_LEN: usize = 28usize;
18623 pub const DEFAULT: Self = Self {
18624 time_boot_ms: 0_u32,
18625 x: 0.0_f32,
18626 y: 0.0_f32,
18627 z: 0.0_f32,
18628 vx: 0.0_f32,
18629 vy: 0.0_f32,
18630 vz: 0.0_f32,
18631 };
18632 #[cfg(feature = "arbitrary")]
18633 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18634 use arbitrary::{Arbitrary, Unstructured};
18635 let mut buf = [0u8; 1024];
18636 rng.fill_bytes(&mut buf);
18637 let mut unstructured = Unstructured::new(&buf);
18638 Self::arbitrary(&mut unstructured).unwrap_or_default()
18639 }
18640}
18641impl Default for LOCAL_POSITION_NED_DATA {
18642 fn default() -> Self {
18643 Self::DEFAULT.clone()
18644 }
18645}
18646impl MessageData for LOCAL_POSITION_NED_DATA {
18647 type Message = MavMessage;
18648 const ID: u32 = 32u32;
18649 const NAME: &'static str = "LOCAL_POSITION_NED";
18650 const EXTRA_CRC: u8 = 185u8;
18651 const ENCODED_LEN: usize = 28usize;
18652 fn deser(
18653 _version: MavlinkVersion,
18654 __input: &[u8],
18655 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18656 let avail_len = __input.len();
18657 let mut payload_buf = [0; Self::ENCODED_LEN];
18658 let mut buf = if avail_len < Self::ENCODED_LEN {
18659 payload_buf[0..avail_len].copy_from_slice(__input);
18660 Bytes::new(&payload_buf)
18661 } else {
18662 Bytes::new(__input)
18663 };
18664 let mut __struct = Self::default();
18665 __struct.time_boot_ms = buf.get_u32_le();
18666 __struct.x = buf.get_f32_le();
18667 __struct.y = buf.get_f32_le();
18668 __struct.z = buf.get_f32_le();
18669 __struct.vx = buf.get_f32_le();
18670 __struct.vy = buf.get_f32_le();
18671 __struct.vz = buf.get_f32_le();
18672 Ok(__struct)
18673 }
18674 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18675 let mut __tmp = BytesMut::new(bytes);
18676 #[allow(clippy::absurd_extreme_comparisons)]
18677 #[allow(unused_comparisons)]
18678 if __tmp.remaining() < Self::ENCODED_LEN {
18679 panic!(
18680 "buffer is too small (need {} bytes, but got {})",
18681 Self::ENCODED_LEN,
18682 __tmp.remaining(),
18683 )
18684 }
18685 __tmp.put_u32_le(self.time_boot_ms);
18686 __tmp.put_f32_le(self.x);
18687 __tmp.put_f32_le(self.y);
18688 __tmp.put_f32_le(self.z);
18689 __tmp.put_f32_le(self.vx);
18690 __tmp.put_f32_le(self.vy);
18691 __tmp.put_f32_le(self.vz);
18692 if matches!(version, MavlinkVersion::V2) {
18693 let len = __tmp.len();
18694 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18695 } else {
18696 __tmp.len()
18697 }
18698 }
18699}
18700#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18701#[doc = ""]
18702#[doc = "ID: 64"]
18703#[derive(Debug, Clone, PartialEq)]
18704#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18705#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18706#[cfg_attr(feature = "ts", derive(TS))]
18707#[cfg_attr(feature = "ts", ts(export))]
18708pub struct LOCAL_POSITION_NED_COV_DATA {
18709 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18710 pub time_usec: u64,
18711 #[doc = "X Position"]
18712 pub x: f32,
18713 #[doc = "Y Position"]
18714 pub y: f32,
18715 #[doc = "Z Position"]
18716 pub z: f32,
18717 #[doc = "X Speed"]
18718 pub vx: f32,
18719 #[doc = "Y Speed"]
18720 pub vy: f32,
18721 #[doc = "Z Speed"]
18722 pub vz: f32,
18723 #[doc = "X Acceleration"]
18724 pub ax: f32,
18725 #[doc = "Y Acceleration"]
18726 pub ay: f32,
18727 #[doc = "Z Acceleration"]
18728 pub az: f32,
18729 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
18730 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18731 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18732 pub covariance: [f32; 45],
18733 #[doc = "Class id of the estimator this estimate originated from."]
18734 pub estimator_type: MavEstimatorType,
18735}
18736impl LOCAL_POSITION_NED_COV_DATA {
18737 pub const ENCODED_LEN: usize = 225usize;
18738 pub const DEFAULT: Self = Self {
18739 time_usec: 0_u64,
18740 x: 0.0_f32,
18741 y: 0.0_f32,
18742 z: 0.0_f32,
18743 vx: 0.0_f32,
18744 vy: 0.0_f32,
18745 vz: 0.0_f32,
18746 ax: 0.0_f32,
18747 ay: 0.0_f32,
18748 az: 0.0_f32,
18749 covariance: [0.0_f32; 45usize],
18750 estimator_type: MavEstimatorType::DEFAULT,
18751 };
18752 #[cfg(feature = "arbitrary")]
18753 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18754 use arbitrary::{Arbitrary, Unstructured};
18755 let mut buf = [0u8; 1024];
18756 rng.fill_bytes(&mut buf);
18757 let mut unstructured = Unstructured::new(&buf);
18758 Self::arbitrary(&mut unstructured).unwrap_or_default()
18759 }
18760}
18761impl Default for LOCAL_POSITION_NED_COV_DATA {
18762 fn default() -> Self {
18763 Self::DEFAULT.clone()
18764 }
18765}
18766impl MessageData for LOCAL_POSITION_NED_COV_DATA {
18767 type Message = MavMessage;
18768 const ID: u32 = 64u32;
18769 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
18770 const EXTRA_CRC: u8 = 191u8;
18771 const ENCODED_LEN: usize = 225usize;
18772 fn deser(
18773 _version: MavlinkVersion,
18774 __input: &[u8],
18775 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18776 let avail_len = __input.len();
18777 let mut payload_buf = [0; Self::ENCODED_LEN];
18778 let mut buf = if avail_len < Self::ENCODED_LEN {
18779 payload_buf[0..avail_len].copy_from_slice(__input);
18780 Bytes::new(&payload_buf)
18781 } else {
18782 Bytes::new(__input)
18783 };
18784 let mut __struct = Self::default();
18785 __struct.time_usec = buf.get_u64_le();
18786 __struct.x = buf.get_f32_le();
18787 __struct.y = buf.get_f32_le();
18788 __struct.z = buf.get_f32_le();
18789 __struct.vx = buf.get_f32_le();
18790 __struct.vy = buf.get_f32_le();
18791 __struct.vz = buf.get_f32_le();
18792 __struct.ax = buf.get_f32_le();
18793 __struct.ay = buf.get_f32_le();
18794 __struct.az = buf.get_f32_le();
18795 for v in &mut __struct.covariance {
18796 let val = buf.get_f32_le();
18797 *v = val;
18798 }
18799 let tmp = buf.get_u8();
18800 __struct.estimator_type =
18801 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18802 enum_type: "MavEstimatorType",
18803 value: tmp as u32,
18804 })?;
18805 Ok(__struct)
18806 }
18807 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18808 let mut __tmp = BytesMut::new(bytes);
18809 #[allow(clippy::absurd_extreme_comparisons)]
18810 #[allow(unused_comparisons)]
18811 if __tmp.remaining() < Self::ENCODED_LEN {
18812 panic!(
18813 "buffer is too small (need {} bytes, but got {})",
18814 Self::ENCODED_LEN,
18815 __tmp.remaining(),
18816 )
18817 }
18818 __tmp.put_u64_le(self.time_usec);
18819 __tmp.put_f32_le(self.x);
18820 __tmp.put_f32_le(self.y);
18821 __tmp.put_f32_le(self.z);
18822 __tmp.put_f32_le(self.vx);
18823 __tmp.put_f32_le(self.vy);
18824 __tmp.put_f32_le(self.vz);
18825 __tmp.put_f32_le(self.ax);
18826 __tmp.put_f32_le(self.ay);
18827 __tmp.put_f32_le(self.az);
18828 for val in &self.covariance {
18829 __tmp.put_f32_le(*val);
18830 }
18831 __tmp.put_u8(self.estimator_type as u8);
18832 if matches!(version, MavlinkVersion::V2) {
18833 let len = __tmp.len();
18834 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18835 } else {
18836 __tmp.len()
18837 }
18838 }
18839}
18840#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18841#[doc = ""]
18842#[doc = "ID: 89"]
18843#[derive(Debug, Clone, PartialEq)]
18844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18845#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18846#[cfg_attr(feature = "ts", derive(TS))]
18847#[cfg_attr(feature = "ts", ts(export))]
18848pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18849 #[doc = "Timestamp (time since system boot)."]
18850 pub time_boot_ms: u32,
18851 #[doc = "X Position"]
18852 pub x: f32,
18853 #[doc = "Y Position"]
18854 pub y: f32,
18855 #[doc = "Z Position"]
18856 pub z: f32,
18857 #[doc = "Roll"]
18858 pub roll: f32,
18859 #[doc = "Pitch"]
18860 pub pitch: f32,
18861 #[doc = "Yaw"]
18862 pub yaw: f32,
18863}
18864impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18865 pub const ENCODED_LEN: usize = 28usize;
18866 pub const DEFAULT: Self = Self {
18867 time_boot_ms: 0_u32,
18868 x: 0.0_f32,
18869 y: 0.0_f32,
18870 z: 0.0_f32,
18871 roll: 0.0_f32,
18872 pitch: 0.0_f32,
18873 yaw: 0.0_f32,
18874 };
18875 #[cfg(feature = "arbitrary")]
18876 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18877 use arbitrary::{Arbitrary, Unstructured};
18878 let mut buf = [0u8; 1024];
18879 rng.fill_bytes(&mut buf);
18880 let mut unstructured = Unstructured::new(&buf);
18881 Self::arbitrary(&mut unstructured).unwrap_or_default()
18882 }
18883}
18884impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18885 fn default() -> Self {
18886 Self::DEFAULT.clone()
18887 }
18888}
18889impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18890 type Message = MavMessage;
18891 const ID: u32 = 89u32;
18892 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
18893 const EXTRA_CRC: u8 = 231u8;
18894 const ENCODED_LEN: usize = 28usize;
18895 fn deser(
18896 _version: MavlinkVersion,
18897 __input: &[u8],
18898 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18899 let avail_len = __input.len();
18900 let mut payload_buf = [0; Self::ENCODED_LEN];
18901 let mut buf = if avail_len < Self::ENCODED_LEN {
18902 payload_buf[0..avail_len].copy_from_slice(__input);
18903 Bytes::new(&payload_buf)
18904 } else {
18905 Bytes::new(__input)
18906 };
18907 let mut __struct = Self::default();
18908 __struct.time_boot_ms = buf.get_u32_le();
18909 __struct.x = buf.get_f32_le();
18910 __struct.y = buf.get_f32_le();
18911 __struct.z = buf.get_f32_le();
18912 __struct.roll = buf.get_f32_le();
18913 __struct.pitch = buf.get_f32_le();
18914 __struct.yaw = buf.get_f32_le();
18915 Ok(__struct)
18916 }
18917 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18918 let mut __tmp = BytesMut::new(bytes);
18919 #[allow(clippy::absurd_extreme_comparisons)]
18920 #[allow(unused_comparisons)]
18921 if __tmp.remaining() < Self::ENCODED_LEN {
18922 panic!(
18923 "buffer is too small (need {} bytes, but got {})",
18924 Self::ENCODED_LEN,
18925 __tmp.remaining(),
18926 )
18927 }
18928 __tmp.put_u32_le(self.time_boot_ms);
18929 __tmp.put_f32_le(self.x);
18930 __tmp.put_f32_le(self.y);
18931 __tmp.put_f32_le(self.z);
18932 __tmp.put_f32_le(self.roll);
18933 __tmp.put_f32_le(self.pitch);
18934 __tmp.put_f32_le(self.yaw);
18935 if matches!(version, MavlinkVersion::V2) {
18936 let len = __tmp.len();
18937 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18938 } else {
18939 __tmp.len()
18940 }
18941 }
18942}
18943#[doc = "An ack for a LOGGING_DATA_ACKED message."]
18944#[doc = ""]
18945#[doc = "ID: 268"]
18946#[derive(Debug, Clone, PartialEq)]
18947#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18948#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18949#[cfg_attr(feature = "ts", derive(TS))]
18950#[cfg_attr(feature = "ts", ts(export))]
18951pub struct LOGGING_ACK_DATA {
18952 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
18953 pub sequence: u16,
18954 #[doc = "system ID of the target"]
18955 pub target_system: u8,
18956 #[doc = "component ID of the target"]
18957 pub target_component: u8,
18958}
18959impl LOGGING_ACK_DATA {
18960 pub const ENCODED_LEN: usize = 4usize;
18961 pub const DEFAULT: Self = Self {
18962 sequence: 0_u16,
18963 target_system: 0_u8,
18964 target_component: 0_u8,
18965 };
18966 #[cfg(feature = "arbitrary")]
18967 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18968 use arbitrary::{Arbitrary, Unstructured};
18969 let mut buf = [0u8; 1024];
18970 rng.fill_bytes(&mut buf);
18971 let mut unstructured = Unstructured::new(&buf);
18972 Self::arbitrary(&mut unstructured).unwrap_or_default()
18973 }
18974}
18975impl Default for LOGGING_ACK_DATA {
18976 fn default() -> Self {
18977 Self::DEFAULT.clone()
18978 }
18979}
18980impl MessageData for LOGGING_ACK_DATA {
18981 type Message = MavMessage;
18982 const ID: u32 = 268u32;
18983 const NAME: &'static str = "LOGGING_ACK";
18984 const EXTRA_CRC: u8 = 14u8;
18985 const ENCODED_LEN: usize = 4usize;
18986 fn deser(
18987 _version: MavlinkVersion,
18988 __input: &[u8],
18989 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18990 let avail_len = __input.len();
18991 let mut payload_buf = [0; Self::ENCODED_LEN];
18992 let mut buf = if avail_len < Self::ENCODED_LEN {
18993 payload_buf[0..avail_len].copy_from_slice(__input);
18994 Bytes::new(&payload_buf)
18995 } else {
18996 Bytes::new(__input)
18997 };
18998 let mut __struct = Self::default();
18999 __struct.sequence = buf.get_u16_le();
19000 __struct.target_system = buf.get_u8();
19001 __struct.target_component = buf.get_u8();
19002 Ok(__struct)
19003 }
19004 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19005 let mut __tmp = BytesMut::new(bytes);
19006 #[allow(clippy::absurd_extreme_comparisons)]
19007 #[allow(unused_comparisons)]
19008 if __tmp.remaining() < Self::ENCODED_LEN {
19009 panic!(
19010 "buffer is too small (need {} bytes, but got {})",
19011 Self::ENCODED_LEN,
19012 __tmp.remaining(),
19013 )
19014 }
19015 __tmp.put_u16_le(self.sequence);
19016 __tmp.put_u8(self.target_system);
19017 __tmp.put_u8(self.target_component);
19018 if matches!(version, MavlinkVersion::V2) {
19019 let len = __tmp.len();
19020 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19021 } else {
19022 __tmp.len()
19023 }
19024 }
19025}
19026#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
19027#[doc = ""]
19028#[doc = "ID: 266"]
19029#[derive(Debug, Clone, PartialEq)]
19030#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19031#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19032#[cfg_attr(feature = "ts", derive(TS))]
19033#[cfg_attr(feature = "ts", ts(export))]
19034pub struct LOGGING_DATA_DATA {
19035 #[doc = "sequence number (can wrap)"]
19036 pub sequence: u16,
19037 #[doc = "system ID of the target"]
19038 pub target_system: u8,
19039 #[doc = "component ID of the target"]
19040 pub target_component: u8,
19041 #[doc = "data length"]
19042 pub length: u8,
19043 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
19044 pub first_message_offset: u8,
19045 #[doc = "logged data"]
19046 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19047 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19048 pub data: [u8; 249],
19049}
19050impl LOGGING_DATA_DATA {
19051 pub const ENCODED_LEN: usize = 255usize;
19052 pub const DEFAULT: Self = Self {
19053 sequence: 0_u16,
19054 target_system: 0_u8,
19055 target_component: 0_u8,
19056 length: 0_u8,
19057 first_message_offset: 0_u8,
19058 data: [0_u8; 249usize],
19059 };
19060 #[cfg(feature = "arbitrary")]
19061 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19062 use arbitrary::{Arbitrary, Unstructured};
19063 let mut buf = [0u8; 1024];
19064 rng.fill_bytes(&mut buf);
19065 let mut unstructured = Unstructured::new(&buf);
19066 Self::arbitrary(&mut unstructured).unwrap_or_default()
19067 }
19068}
19069impl Default for LOGGING_DATA_DATA {
19070 fn default() -> Self {
19071 Self::DEFAULT.clone()
19072 }
19073}
19074impl MessageData for LOGGING_DATA_DATA {
19075 type Message = MavMessage;
19076 const ID: u32 = 266u32;
19077 const NAME: &'static str = "LOGGING_DATA";
19078 const EXTRA_CRC: u8 = 193u8;
19079 const ENCODED_LEN: usize = 255usize;
19080 fn deser(
19081 _version: MavlinkVersion,
19082 __input: &[u8],
19083 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19084 let avail_len = __input.len();
19085 let mut payload_buf = [0; Self::ENCODED_LEN];
19086 let mut buf = if avail_len < Self::ENCODED_LEN {
19087 payload_buf[0..avail_len].copy_from_slice(__input);
19088 Bytes::new(&payload_buf)
19089 } else {
19090 Bytes::new(__input)
19091 };
19092 let mut __struct = Self::default();
19093 __struct.sequence = buf.get_u16_le();
19094 __struct.target_system = buf.get_u8();
19095 __struct.target_component = buf.get_u8();
19096 __struct.length = buf.get_u8();
19097 __struct.first_message_offset = buf.get_u8();
19098 for v in &mut __struct.data {
19099 let val = buf.get_u8();
19100 *v = val;
19101 }
19102 Ok(__struct)
19103 }
19104 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19105 let mut __tmp = BytesMut::new(bytes);
19106 #[allow(clippy::absurd_extreme_comparisons)]
19107 #[allow(unused_comparisons)]
19108 if __tmp.remaining() < Self::ENCODED_LEN {
19109 panic!(
19110 "buffer is too small (need {} bytes, but got {})",
19111 Self::ENCODED_LEN,
19112 __tmp.remaining(),
19113 )
19114 }
19115 __tmp.put_u16_le(self.sequence);
19116 __tmp.put_u8(self.target_system);
19117 __tmp.put_u8(self.target_component);
19118 __tmp.put_u8(self.length);
19119 __tmp.put_u8(self.first_message_offset);
19120 for val in &self.data {
19121 __tmp.put_u8(*val);
19122 }
19123 if matches!(version, MavlinkVersion::V2) {
19124 let len = __tmp.len();
19125 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19126 } else {
19127 __tmp.len()
19128 }
19129 }
19130}
19131#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
19132#[doc = ""]
19133#[doc = "ID: 267"]
19134#[derive(Debug, Clone, PartialEq)]
19135#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19136#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19137#[cfg_attr(feature = "ts", derive(TS))]
19138#[cfg_attr(feature = "ts", ts(export))]
19139pub struct LOGGING_DATA_ACKED_DATA {
19140 #[doc = "sequence number (can wrap)"]
19141 pub sequence: u16,
19142 #[doc = "system ID of the target"]
19143 pub target_system: u8,
19144 #[doc = "component ID of the target"]
19145 pub target_component: u8,
19146 #[doc = "data length"]
19147 pub length: u8,
19148 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
19149 pub first_message_offset: u8,
19150 #[doc = "logged data"]
19151 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19152 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19153 pub data: [u8; 249],
19154}
19155impl LOGGING_DATA_ACKED_DATA {
19156 pub const ENCODED_LEN: usize = 255usize;
19157 pub const DEFAULT: Self = Self {
19158 sequence: 0_u16,
19159 target_system: 0_u8,
19160 target_component: 0_u8,
19161 length: 0_u8,
19162 first_message_offset: 0_u8,
19163 data: [0_u8; 249usize],
19164 };
19165 #[cfg(feature = "arbitrary")]
19166 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19167 use arbitrary::{Arbitrary, Unstructured};
19168 let mut buf = [0u8; 1024];
19169 rng.fill_bytes(&mut buf);
19170 let mut unstructured = Unstructured::new(&buf);
19171 Self::arbitrary(&mut unstructured).unwrap_or_default()
19172 }
19173}
19174impl Default for LOGGING_DATA_ACKED_DATA {
19175 fn default() -> Self {
19176 Self::DEFAULT.clone()
19177 }
19178}
19179impl MessageData for LOGGING_DATA_ACKED_DATA {
19180 type Message = MavMessage;
19181 const ID: u32 = 267u32;
19182 const NAME: &'static str = "LOGGING_DATA_ACKED";
19183 const EXTRA_CRC: u8 = 35u8;
19184 const ENCODED_LEN: usize = 255usize;
19185 fn deser(
19186 _version: MavlinkVersion,
19187 __input: &[u8],
19188 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19189 let avail_len = __input.len();
19190 let mut payload_buf = [0; Self::ENCODED_LEN];
19191 let mut buf = if avail_len < Self::ENCODED_LEN {
19192 payload_buf[0..avail_len].copy_from_slice(__input);
19193 Bytes::new(&payload_buf)
19194 } else {
19195 Bytes::new(__input)
19196 };
19197 let mut __struct = Self::default();
19198 __struct.sequence = buf.get_u16_le();
19199 __struct.target_system = buf.get_u8();
19200 __struct.target_component = buf.get_u8();
19201 __struct.length = buf.get_u8();
19202 __struct.first_message_offset = buf.get_u8();
19203 for v in &mut __struct.data {
19204 let val = buf.get_u8();
19205 *v = val;
19206 }
19207 Ok(__struct)
19208 }
19209 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19210 let mut __tmp = BytesMut::new(bytes);
19211 #[allow(clippy::absurd_extreme_comparisons)]
19212 #[allow(unused_comparisons)]
19213 if __tmp.remaining() < Self::ENCODED_LEN {
19214 panic!(
19215 "buffer is too small (need {} bytes, but got {})",
19216 Self::ENCODED_LEN,
19217 __tmp.remaining(),
19218 )
19219 }
19220 __tmp.put_u16_le(self.sequence);
19221 __tmp.put_u8(self.target_system);
19222 __tmp.put_u8(self.target_component);
19223 __tmp.put_u8(self.length);
19224 __tmp.put_u8(self.first_message_offset);
19225 for val in &self.data {
19226 __tmp.put_u8(*val);
19227 }
19228 if matches!(version, MavlinkVersion::V2) {
19229 let len = __tmp.len();
19230 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19231 } else {
19232 __tmp.len()
19233 }
19234 }
19235}
19236#[doc = "Reply to LOG_REQUEST_DATA."]
19237#[doc = ""]
19238#[doc = "ID: 120"]
19239#[derive(Debug, Clone, PartialEq)]
19240#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19241#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19242#[cfg_attr(feature = "ts", derive(TS))]
19243#[cfg_attr(feature = "ts", ts(export))]
19244pub struct LOG_DATA_DATA {
19245 #[doc = "Offset into the log"]
19246 pub ofs: u32,
19247 #[doc = "Log id (from LOG_ENTRY reply)"]
19248 pub id: u16,
19249 #[doc = "Number of bytes (zero for end of log)"]
19250 pub count: u8,
19251 #[doc = "log data"]
19252 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19253 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19254 pub data: [u8; 90],
19255}
19256impl LOG_DATA_DATA {
19257 pub const ENCODED_LEN: usize = 97usize;
19258 pub const DEFAULT: Self = Self {
19259 ofs: 0_u32,
19260 id: 0_u16,
19261 count: 0_u8,
19262 data: [0_u8; 90usize],
19263 };
19264 #[cfg(feature = "arbitrary")]
19265 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19266 use arbitrary::{Arbitrary, Unstructured};
19267 let mut buf = [0u8; 1024];
19268 rng.fill_bytes(&mut buf);
19269 let mut unstructured = Unstructured::new(&buf);
19270 Self::arbitrary(&mut unstructured).unwrap_or_default()
19271 }
19272}
19273impl Default for LOG_DATA_DATA {
19274 fn default() -> Self {
19275 Self::DEFAULT.clone()
19276 }
19277}
19278impl MessageData for LOG_DATA_DATA {
19279 type Message = MavMessage;
19280 const ID: u32 = 120u32;
19281 const NAME: &'static str = "LOG_DATA";
19282 const EXTRA_CRC: u8 = 134u8;
19283 const ENCODED_LEN: usize = 97usize;
19284 fn deser(
19285 _version: MavlinkVersion,
19286 __input: &[u8],
19287 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19288 let avail_len = __input.len();
19289 let mut payload_buf = [0; Self::ENCODED_LEN];
19290 let mut buf = if avail_len < Self::ENCODED_LEN {
19291 payload_buf[0..avail_len].copy_from_slice(__input);
19292 Bytes::new(&payload_buf)
19293 } else {
19294 Bytes::new(__input)
19295 };
19296 let mut __struct = Self::default();
19297 __struct.ofs = buf.get_u32_le();
19298 __struct.id = buf.get_u16_le();
19299 __struct.count = buf.get_u8();
19300 for v in &mut __struct.data {
19301 let val = buf.get_u8();
19302 *v = val;
19303 }
19304 Ok(__struct)
19305 }
19306 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19307 let mut __tmp = BytesMut::new(bytes);
19308 #[allow(clippy::absurd_extreme_comparisons)]
19309 #[allow(unused_comparisons)]
19310 if __tmp.remaining() < Self::ENCODED_LEN {
19311 panic!(
19312 "buffer is too small (need {} bytes, but got {})",
19313 Self::ENCODED_LEN,
19314 __tmp.remaining(),
19315 )
19316 }
19317 __tmp.put_u32_le(self.ofs);
19318 __tmp.put_u16_le(self.id);
19319 __tmp.put_u8(self.count);
19320 for val in &self.data {
19321 __tmp.put_u8(*val);
19322 }
19323 if matches!(version, MavlinkVersion::V2) {
19324 let len = __tmp.len();
19325 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19326 } else {
19327 __tmp.len()
19328 }
19329 }
19330}
19331#[doc = "Reply to LOG_REQUEST_LIST."]
19332#[doc = ""]
19333#[doc = "ID: 118"]
19334#[derive(Debug, Clone, PartialEq)]
19335#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19336#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19337#[cfg_attr(feature = "ts", derive(TS))]
19338#[cfg_attr(feature = "ts", ts(export))]
19339pub struct LOG_ENTRY_DATA {
19340 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
19341 pub time_utc: u32,
19342 #[doc = "Size of the log (may be approximate)"]
19343 pub size: u32,
19344 #[doc = "Log id"]
19345 pub id: u16,
19346 #[doc = "Total number of logs"]
19347 pub num_logs: u16,
19348 #[doc = "High log number"]
19349 pub last_log_num: u16,
19350}
19351impl LOG_ENTRY_DATA {
19352 pub const ENCODED_LEN: usize = 14usize;
19353 pub const DEFAULT: Self = Self {
19354 time_utc: 0_u32,
19355 size: 0_u32,
19356 id: 0_u16,
19357 num_logs: 0_u16,
19358 last_log_num: 0_u16,
19359 };
19360 #[cfg(feature = "arbitrary")]
19361 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19362 use arbitrary::{Arbitrary, Unstructured};
19363 let mut buf = [0u8; 1024];
19364 rng.fill_bytes(&mut buf);
19365 let mut unstructured = Unstructured::new(&buf);
19366 Self::arbitrary(&mut unstructured).unwrap_or_default()
19367 }
19368}
19369impl Default for LOG_ENTRY_DATA {
19370 fn default() -> Self {
19371 Self::DEFAULT.clone()
19372 }
19373}
19374impl MessageData for LOG_ENTRY_DATA {
19375 type Message = MavMessage;
19376 const ID: u32 = 118u32;
19377 const NAME: &'static str = "LOG_ENTRY";
19378 const EXTRA_CRC: u8 = 56u8;
19379 const ENCODED_LEN: usize = 14usize;
19380 fn deser(
19381 _version: MavlinkVersion,
19382 __input: &[u8],
19383 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19384 let avail_len = __input.len();
19385 let mut payload_buf = [0; Self::ENCODED_LEN];
19386 let mut buf = if avail_len < Self::ENCODED_LEN {
19387 payload_buf[0..avail_len].copy_from_slice(__input);
19388 Bytes::new(&payload_buf)
19389 } else {
19390 Bytes::new(__input)
19391 };
19392 let mut __struct = Self::default();
19393 __struct.time_utc = buf.get_u32_le();
19394 __struct.size = buf.get_u32_le();
19395 __struct.id = buf.get_u16_le();
19396 __struct.num_logs = buf.get_u16_le();
19397 __struct.last_log_num = buf.get_u16_le();
19398 Ok(__struct)
19399 }
19400 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19401 let mut __tmp = BytesMut::new(bytes);
19402 #[allow(clippy::absurd_extreme_comparisons)]
19403 #[allow(unused_comparisons)]
19404 if __tmp.remaining() < Self::ENCODED_LEN {
19405 panic!(
19406 "buffer is too small (need {} bytes, but got {})",
19407 Self::ENCODED_LEN,
19408 __tmp.remaining(),
19409 )
19410 }
19411 __tmp.put_u32_le(self.time_utc);
19412 __tmp.put_u32_le(self.size);
19413 __tmp.put_u16_le(self.id);
19414 __tmp.put_u16_le(self.num_logs);
19415 __tmp.put_u16_le(self.last_log_num);
19416 if matches!(version, MavlinkVersion::V2) {
19417 let len = __tmp.len();
19418 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19419 } else {
19420 __tmp.len()
19421 }
19422 }
19423}
19424#[doc = "Erase all logs."]
19425#[doc = ""]
19426#[doc = "ID: 121"]
19427#[derive(Debug, Clone, PartialEq)]
19428#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19429#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19430#[cfg_attr(feature = "ts", derive(TS))]
19431#[cfg_attr(feature = "ts", ts(export))]
19432pub struct LOG_ERASE_DATA {
19433 #[doc = "System ID"]
19434 pub target_system: u8,
19435 #[doc = "Component ID"]
19436 pub target_component: u8,
19437}
19438impl LOG_ERASE_DATA {
19439 pub const ENCODED_LEN: usize = 2usize;
19440 pub const DEFAULT: Self = Self {
19441 target_system: 0_u8,
19442 target_component: 0_u8,
19443 };
19444 #[cfg(feature = "arbitrary")]
19445 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19446 use arbitrary::{Arbitrary, Unstructured};
19447 let mut buf = [0u8; 1024];
19448 rng.fill_bytes(&mut buf);
19449 let mut unstructured = Unstructured::new(&buf);
19450 Self::arbitrary(&mut unstructured).unwrap_or_default()
19451 }
19452}
19453impl Default for LOG_ERASE_DATA {
19454 fn default() -> Self {
19455 Self::DEFAULT.clone()
19456 }
19457}
19458impl MessageData for LOG_ERASE_DATA {
19459 type Message = MavMessage;
19460 const ID: u32 = 121u32;
19461 const NAME: &'static str = "LOG_ERASE";
19462 const EXTRA_CRC: u8 = 237u8;
19463 const ENCODED_LEN: usize = 2usize;
19464 fn deser(
19465 _version: MavlinkVersion,
19466 __input: &[u8],
19467 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19468 let avail_len = __input.len();
19469 let mut payload_buf = [0; Self::ENCODED_LEN];
19470 let mut buf = if avail_len < Self::ENCODED_LEN {
19471 payload_buf[0..avail_len].copy_from_slice(__input);
19472 Bytes::new(&payload_buf)
19473 } else {
19474 Bytes::new(__input)
19475 };
19476 let mut __struct = Self::default();
19477 __struct.target_system = buf.get_u8();
19478 __struct.target_component = buf.get_u8();
19479 Ok(__struct)
19480 }
19481 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19482 let mut __tmp = BytesMut::new(bytes);
19483 #[allow(clippy::absurd_extreme_comparisons)]
19484 #[allow(unused_comparisons)]
19485 if __tmp.remaining() < Self::ENCODED_LEN {
19486 panic!(
19487 "buffer is too small (need {} bytes, but got {})",
19488 Self::ENCODED_LEN,
19489 __tmp.remaining(),
19490 )
19491 }
19492 __tmp.put_u8(self.target_system);
19493 __tmp.put_u8(self.target_component);
19494 if matches!(version, MavlinkVersion::V2) {
19495 let len = __tmp.len();
19496 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19497 } else {
19498 __tmp.len()
19499 }
19500 }
19501}
19502#[doc = "Request a chunk of a log."]
19503#[doc = ""]
19504#[doc = "ID: 119"]
19505#[derive(Debug, Clone, PartialEq)]
19506#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19507#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19508#[cfg_attr(feature = "ts", derive(TS))]
19509#[cfg_attr(feature = "ts", ts(export))]
19510pub struct LOG_REQUEST_DATA_DATA {
19511 #[doc = "Offset into the log"]
19512 pub ofs: u32,
19513 #[doc = "Number of bytes"]
19514 pub count: u32,
19515 #[doc = "Log id (from LOG_ENTRY reply)"]
19516 pub id: u16,
19517 #[doc = "System ID"]
19518 pub target_system: u8,
19519 #[doc = "Component ID"]
19520 pub target_component: u8,
19521}
19522impl LOG_REQUEST_DATA_DATA {
19523 pub const ENCODED_LEN: usize = 12usize;
19524 pub const DEFAULT: Self = Self {
19525 ofs: 0_u32,
19526 count: 0_u32,
19527 id: 0_u16,
19528 target_system: 0_u8,
19529 target_component: 0_u8,
19530 };
19531 #[cfg(feature = "arbitrary")]
19532 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19533 use arbitrary::{Arbitrary, Unstructured};
19534 let mut buf = [0u8; 1024];
19535 rng.fill_bytes(&mut buf);
19536 let mut unstructured = Unstructured::new(&buf);
19537 Self::arbitrary(&mut unstructured).unwrap_or_default()
19538 }
19539}
19540impl Default for LOG_REQUEST_DATA_DATA {
19541 fn default() -> Self {
19542 Self::DEFAULT.clone()
19543 }
19544}
19545impl MessageData for LOG_REQUEST_DATA_DATA {
19546 type Message = MavMessage;
19547 const ID: u32 = 119u32;
19548 const NAME: &'static str = "LOG_REQUEST_DATA";
19549 const EXTRA_CRC: u8 = 116u8;
19550 const ENCODED_LEN: usize = 12usize;
19551 fn deser(
19552 _version: MavlinkVersion,
19553 __input: &[u8],
19554 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19555 let avail_len = __input.len();
19556 let mut payload_buf = [0; Self::ENCODED_LEN];
19557 let mut buf = if avail_len < Self::ENCODED_LEN {
19558 payload_buf[0..avail_len].copy_from_slice(__input);
19559 Bytes::new(&payload_buf)
19560 } else {
19561 Bytes::new(__input)
19562 };
19563 let mut __struct = Self::default();
19564 __struct.ofs = buf.get_u32_le();
19565 __struct.count = buf.get_u32_le();
19566 __struct.id = buf.get_u16_le();
19567 __struct.target_system = buf.get_u8();
19568 __struct.target_component = buf.get_u8();
19569 Ok(__struct)
19570 }
19571 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19572 let mut __tmp = BytesMut::new(bytes);
19573 #[allow(clippy::absurd_extreme_comparisons)]
19574 #[allow(unused_comparisons)]
19575 if __tmp.remaining() < Self::ENCODED_LEN {
19576 panic!(
19577 "buffer is too small (need {} bytes, but got {})",
19578 Self::ENCODED_LEN,
19579 __tmp.remaining(),
19580 )
19581 }
19582 __tmp.put_u32_le(self.ofs);
19583 __tmp.put_u32_le(self.count);
19584 __tmp.put_u16_le(self.id);
19585 __tmp.put_u8(self.target_system);
19586 __tmp.put_u8(self.target_component);
19587 if matches!(version, MavlinkVersion::V2) {
19588 let len = __tmp.len();
19589 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19590 } else {
19591 __tmp.len()
19592 }
19593 }
19594}
19595#[doc = "Stop log transfer and resume normal logging."]
19596#[doc = ""]
19597#[doc = "ID: 122"]
19598#[derive(Debug, Clone, PartialEq)]
19599#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19600#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19601#[cfg_attr(feature = "ts", derive(TS))]
19602#[cfg_attr(feature = "ts", ts(export))]
19603pub struct LOG_REQUEST_END_DATA {
19604 #[doc = "System ID"]
19605 pub target_system: u8,
19606 #[doc = "Component ID"]
19607 pub target_component: u8,
19608}
19609impl LOG_REQUEST_END_DATA {
19610 pub const ENCODED_LEN: usize = 2usize;
19611 pub const DEFAULT: Self = Self {
19612 target_system: 0_u8,
19613 target_component: 0_u8,
19614 };
19615 #[cfg(feature = "arbitrary")]
19616 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19617 use arbitrary::{Arbitrary, Unstructured};
19618 let mut buf = [0u8; 1024];
19619 rng.fill_bytes(&mut buf);
19620 let mut unstructured = Unstructured::new(&buf);
19621 Self::arbitrary(&mut unstructured).unwrap_or_default()
19622 }
19623}
19624impl Default for LOG_REQUEST_END_DATA {
19625 fn default() -> Self {
19626 Self::DEFAULT.clone()
19627 }
19628}
19629impl MessageData for LOG_REQUEST_END_DATA {
19630 type Message = MavMessage;
19631 const ID: u32 = 122u32;
19632 const NAME: &'static str = "LOG_REQUEST_END";
19633 const EXTRA_CRC: u8 = 203u8;
19634 const ENCODED_LEN: usize = 2usize;
19635 fn deser(
19636 _version: MavlinkVersion,
19637 __input: &[u8],
19638 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19639 let avail_len = __input.len();
19640 let mut payload_buf = [0; Self::ENCODED_LEN];
19641 let mut buf = if avail_len < Self::ENCODED_LEN {
19642 payload_buf[0..avail_len].copy_from_slice(__input);
19643 Bytes::new(&payload_buf)
19644 } else {
19645 Bytes::new(__input)
19646 };
19647 let mut __struct = Self::default();
19648 __struct.target_system = buf.get_u8();
19649 __struct.target_component = buf.get_u8();
19650 Ok(__struct)
19651 }
19652 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19653 let mut __tmp = BytesMut::new(bytes);
19654 #[allow(clippy::absurd_extreme_comparisons)]
19655 #[allow(unused_comparisons)]
19656 if __tmp.remaining() < Self::ENCODED_LEN {
19657 panic!(
19658 "buffer is too small (need {} bytes, but got {})",
19659 Self::ENCODED_LEN,
19660 __tmp.remaining(),
19661 )
19662 }
19663 __tmp.put_u8(self.target_system);
19664 __tmp.put_u8(self.target_component);
19665 if matches!(version, MavlinkVersion::V2) {
19666 let len = __tmp.len();
19667 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19668 } else {
19669 __tmp.len()
19670 }
19671 }
19672}
19673#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
19674#[doc = ""]
19675#[doc = "ID: 117"]
19676#[derive(Debug, Clone, PartialEq)]
19677#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19678#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19679#[cfg_attr(feature = "ts", derive(TS))]
19680#[cfg_attr(feature = "ts", ts(export))]
19681pub struct LOG_REQUEST_LIST_DATA {
19682 #[doc = "First log id (0 for first available)"]
19683 pub start: u16,
19684 #[doc = "Last log id (0xffff for last available)"]
19685 pub end: u16,
19686 #[doc = "System ID"]
19687 pub target_system: u8,
19688 #[doc = "Component ID"]
19689 pub target_component: u8,
19690}
19691impl LOG_REQUEST_LIST_DATA {
19692 pub const ENCODED_LEN: usize = 6usize;
19693 pub const DEFAULT: Self = Self {
19694 start: 0_u16,
19695 end: 0_u16,
19696 target_system: 0_u8,
19697 target_component: 0_u8,
19698 };
19699 #[cfg(feature = "arbitrary")]
19700 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19701 use arbitrary::{Arbitrary, Unstructured};
19702 let mut buf = [0u8; 1024];
19703 rng.fill_bytes(&mut buf);
19704 let mut unstructured = Unstructured::new(&buf);
19705 Self::arbitrary(&mut unstructured).unwrap_or_default()
19706 }
19707}
19708impl Default for LOG_REQUEST_LIST_DATA {
19709 fn default() -> Self {
19710 Self::DEFAULT.clone()
19711 }
19712}
19713impl MessageData for LOG_REQUEST_LIST_DATA {
19714 type Message = MavMessage;
19715 const ID: u32 = 117u32;
19716 const NAME: &'static str = "LOG_REQUEST_LIST";
19717 const EXTRA_CRC: u8 = 128u8;
19718 const ENCODED_LEN: usize = 6usize;
19719 fn deser(
19720 _version: MavlinkVersion,
19721 __input: &[u8],
19722 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19723 let avail_len = __input.len();
19724 let mut payload_buf = [0; Self::ENCODED_LEN];
19725 let mut buf = if avail_len < Self::ENCODED_LEN {
19726 payload_buf[0..avail_len].copy_from_slice(__input);
19727 Bytes::new(&payload_buf)
19728 } else {
19729 Bytes::new(__input)
19730 };
19731 let mut __struct = Self::default();
19732 __struct.start = buf.get_u16_le();
19733 __struct.end = buf.get_u16_le();
19734 __struct.target_system = buf.get_u8();
19735 __struct.target_component = buf.get_u8();
19736 Ok(__struct)
19737 }
19738 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19739 let mut __tmp = BytesMut::new(bytes);
19740 #[allow(clippy::absurd_extreme_comparisons)]
19741 #[allow(unused_comparisons)]
19742 if __tmp.remaining() < Self::ENCODED_LEN {
19743 panic!(
19744 "buffer is too small (need {} bytes, but got {})",
19745 Self::ENCODED_LEN,
19746 __tmp.remaining(),
19747 )
19748 }
19749 __tmp.put_u16_le(self.start);
19750 __tmp.put_u16_le(self.end);
19751 __tmp.put_u8(self.target_system);
19752 __tmp.put_u8(self.target_component);
19753 if matches!(version, MavlinkVersion::V2) {
19754 let len = __tmp.len();
19755 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19756 } else {
19757 __tmp.len()
19758 }
19759 }
19760}
19761#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
19762#[doc = ""]
19763#[doc = "ID: 192"]
19764#[derive(Debug, Clone, PartialEq)]
19765#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19766#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19767#[cfg_attr(feature = "ts", derive(TS))]
19768#[cfg_attr(feature = "ts", ts(export))]
19769pub struct MAG_CAL_REPORT_DATA {
19770 #[doc = "RMS milligauss residuals."]
19771 pub fitness: f32,
19772 #[doc = "X offset."]
19773 pub ofs_x: f32,
19774 #[doc = "Y offset."]
19775 pub ofs_y: f32,
19776 #[doc = "Z offset."]
19777 pub ofs_z: f32,
19778 #[doc = "X diagonal (matrix 11)."]
19779 pub diag_x: f32,
19780 #[doc = "Y diagonal (matrix 22)."]
19781 pub diag_y: f32,
19782 #[doc = "Z diagonal (matrix 33)."]
19783 pub diag_z: f32,
19784 #[doc = "X off-diagonal (matrix 12 and 21)."]
19785 pub offdiag_x: f32,
19786 #[doc = "Y off-diagonal (matrix 13 and 31)."]
19787 pub offdiag_y: f32,
19788 #[doc = "Z off-diagonal (matrix 32 and 23)."]
19789 pub offdiag_z: f32,
19790 #[doc = "Compass being calibrated."]
19791 pub compass_id: u8,
19792 #[doc = "Bitmask of compasses being calibrated."]
19793 pub cal_mask: u8,
19794 #[doc = "Calibration Status."]
19795 pub cal_status: MagCalStatus,
19796 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
19797 pub autosaved: u8,
19798 #[doc = "Confidence in orientation (higher is better)."]
19799 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19800 pub orientation_confidence: f32,
19801 #[doc = "orientation before calibration."]
19802 #[cfg_attr(feature = "serde", serde(default))]
19803 pub old_orientation: MavSensorOrientation,
19804 #[doc = "orientation after calibration."]
19805 #[cfg_attr(feature = "serde", serde(default))]
19806 pub new_orientation: MavSensorOrientation,
19807 #[doc = "field radius correction factor"]
19808 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19809 pub scale_factor: f32,
19810}
19811impl MAG_CAL_REPORT_DATA {
19812 pub const ENCODED_LEN: usize = 54usize;
19813 pub const DEFAULT: Self = Self {
19814 fitness: 0.0_f32,
19815 ofs_x: 0.0_f32,
19816 ofs_y: 0.0_f32,
19817 ofs_z: 0.0_f32,
19818 diag_x: 0.0_f32,
19819 diag_y: 0.0_f32,
19820 diag_z: 0.0_f32,
19821 offdiag_x: 0.0_f32,
19822 offdiag_y: 0.0_f32,
19823 offdiag_z: 0.0_f32,
19824 compass_id: 0_u8,
19825 cal_mask: 0_u8,
19826 cal_status: MagCalStatus::DEFAULT,
19827 autosaved: 0_u8,
19828 orientation_confidence: 0.0_f32,
19829 old_orientation: MavSensorOrientation::DEFAULT,
19830 new_orientation: MavSensorOrientation::DEFAULT,
19831 scale_factor: 0.0_f32,
19832 };
19833 #[cfg(feature = "arbitrary")]
19834 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19835 use arbitrary::{Arbitrary, Unstructured};
19836 let mut buf = [0u8; 1024];
19837 rng.fill_bytes(&mut buf);
19838 let mut unstructured = Unstructured::new(&buf);
19839 Self::arbitrary(&mut unstructured).unwrap_or_default()
19840 }
19841}
19842impl Default for MAG_CAL_REPORT_DATA {
19843 fn default() -> Self {
19844 Self::DEFAULT.clone()
19845 }
19846}
19847impl MessageData for MAG_CAL_REPORT_DATA {
19848 type Message = MavMessage;
19849 const ID: u32 = 192u32;
19850 const NAME: &'static str = "MAG_CAL_REPORT";
19851 const EXTRA_CRC: u8 = 36u8;
19852 const ENCODED_LEN: usize = 54usize;
19853 fn deser(
19854 _version: MavlinkVersion,
19855 __input: &[u8],
19856 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19857 let avail_len = __input.len();
19858 let mut payload_buf = [0; Self::ENCODED_LEN];
19859 let mut buf = if avail_len < Self::ENCODED_LEN {
19860 payload_buf[0..avail_len].copy_from_slice(__input);
19861 Bytes::new(&payload_buf)
19862 } else {
19863 Bytes::new(__input)
19864 };
19865 let mut __struct = Self::default();
19866 __struct.fitness = buf.get_f32_le();
19867 __struct.ofs_x = buf.get_f32_le();
19868 __struct.ofs_y = buf.get_f32_le();
19869 __struct.ofs_z = buf.get_f32_le();
19870 __struct.diag_x = buf.get_f32_le();
19871 __struct.diag_y = buf.get_f32_le();
19872 __struct.diag_z = buf.get_f32_le();
19873 __struct.offdiag_x = buf.get_f32_le();
19874 __struct.offdiag_y = buf.get_f32_le();
19875 __struct.offdiag_z = buf.get_f32_le();
19876 __struct.compass_id = buf.get_u8();
19877 __struct.cal_mask = buf.get_u8();
19878 let tmp = buf.get_u8();
19879 __struct.cal_status =
19880 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19881 enum_type: "MagCalStatus",
19882 value: tmp as u32,
19883 })?;
19884 __struct.autosaved = buf.get_u8();
19885 __struct.orientation_confidence = buf.get_f32_le();
19886 let tmp = buf.get_u8();
19887 __struct.old_orientation =
19888 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19889 enum_type: "MavSensorOrientation",
19890 value: tmp as u32,
19891 })?;
19892 let tmp = buf.get_u8();
19893 __struct.new_orientation =
19894 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19895 enum_type: "MavSensorOrientation",
19896 value: tmp as u32,
19897 })?;
19898 __struct.scale_factor = buf.get_f32_le();
19899 Ok(__struct)
19900 }
19901 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19902 let mut __tmp = BytesMut::new(bytes);
19903 #[allow(clippy::absurd_extreme_comparisons)]
19904 #[allow(unused_comparisons)]
19905 if __tmp.remaining() < Self::ENCODED_LEN {
19906 panic!(
19907 "buffer is too small (need {} bytes, but got {})",
19908 Self::ENCODED_LEN,
19909 __tmp.remaining(),
19910 )
19911 }
19912 __tmp.put_f32_le(self.fitness);
19913 __tmp.put_f32_le(self.ofs_x);
19914 __tmp.put_f32_le(self.ofs_y);
19915 __tmp.put_f32_le(self.ofs_z);
19916 __tmp.put_f32_le(self.diag_x);
19917 __tmp.put_f32_le(self.diag_y);
19918 __tmp.put_f32_le(self.diag_z);
19919 __tmp.put_f32_le(self.offdiag_x);
19920 __tmp.put_f32_le(self.offdiag_y);
19921 __tmp.put_f32_le(self.offdiag_z);
19922 __tmp.put_u8(self.compass_id);
19923 __tmp.put_u8(self.cal_mask);
19924 __tmp.put_u8(self.cal_status as u8);
19925 __tmp.put_u8(self.autosaved);
19926 if matches!(version, MavlinkVersion::V2) {
19927 __tmp.put_f32_le(self.orientation_confidence);
19928 __tmp.put_u8(self.old_orientation as u8);
19929 __tmp.put_u8(self.new_orientation as u8);
19930 __tmp.put_f32_le(self.scale_factor);
19931 let len = __tmp.len();
19932 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19933 } else {
19934 __tmp.len()
19935 }
19936 }
19937}
19938#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
19939#[doc = ""]
19940#[doc = "ID: 69"]
19941#[derive(Debug, Clone, PartialEq)]
19942#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19943#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19944#[cfg_attr(feature = "ts", derive(TS))]
19945#[cfg_attr(feature = "ts", ts(export))]
19946pub struct MANUAL_CONTROL_DATA {
19947 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
19948 pub x: i16,
19949 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
19950 pub y: i16,
19951 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
19952 pub z: i16,
19953 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
19954 pub r: i16,
19955 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
19956 pub buttons: u16,
19957 #[doc = "The system to be controlled."]
19958 pub target: u8,
19959 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
19960 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19961 pub buttons2: u16,
19962 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
19963 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19964 pub enabled_extensions: u8,
19965 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
19966 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19967 pub s: i16,
19968 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
19969 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19970 pub t: i16,
19971 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
19972 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19973 pub aux1: i16,
19974 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
19975 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19976 pub aux2: i16,
19977 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
19978 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19979 pub aux3: i16,
19980 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
19981 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19982 pub aux4: i16,
19983 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
19984 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19985 pub aux5: i16,
19986 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
19987 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19988 pub aux6: i16,
19989}
19990impl MANUAL_CONTROL_DATA {
19991 pub const ENCODED_LEN: usize = 30usize;
19992 pub const DEFAULT: Self = Self {
19993 x: 0_i16,
19994 y: 0_i16,
19995 z: 0_i16,
19996 r: 0_i16,
19997 buttons: 0_u16,
19998 target: 0_u8,
19999 buttons2: 0_u16,
20000 enabled_extensions: 0_u8,
20001 s: 0_i16,
20002 t: 0_i16,
20003 aux1: 0_i16,
20004 aux2: 0_i16,
20005 aux3: 0_i16,
20006 aux4: 0_i16,
20007 aux5: 0_i16,
20008 aux6: 0_i16,
20009 };
20010 #[cfg(feature = "arbitrary")]
20011 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20012 use arbitrary::{Arbitrary, Unstructured};
20013 let mut buf = [0u8; 1024];
20014 rng.fill_bytes(&mut buf);
20015 let mut unstructured = Unstructured::new(&buf);
20016 Self::arbitrary(&mut unstructured).unwrap_or_default()
20017 }
20018}
20019impl Default for MANUAL_CONTROL_DATA {
20020 fn default() -> Self {
20021 Self::DEFAULT.clone()
20022 }
20023}
20024impl MessageData for MANUAL_CONTROL_DATA {
20025 type Message = MavMessage;
20026 const ID: u32 = 69u32;
20027 const NAME: &'static str = "MANUAL_CONTROL";
20028 const EXTRA_CRC: u8 = 243u8;
20029 const ENCODED_LEN: usize = 30usize;
20030 fn deser(
20031 _version: MavlinkVersion,
20032 __input: &[u8],
20033 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20034 let avail_len = __input.len();
20035 let mut payload_buf = [0; Self::ENCODED_LEN];
20036 let mut buf = if avail_len < Self::ENCODED_LEN {
20037 payload_buf[0..avail_len].copy_from_slice(__input);
20038 Bytes::new(&payload_buf)
20039 } else {
20040 Bytes::new(__input)
20041 };
20042 let mut __struct = Self::default();
20043 __struct.x = buf.get_i16_le();
20044 __struct.y = buf.get_i16_le();
20045 __struct.z = buf.get_i16_le();
20046 __struct.r = buf.get_i16_le();
20047 __struct.buttons = buf.get_u16_le();
20048 __struct.target = buf.get_u8();
20049 __struct.buttons2 = buf.get_u16_le();
20050 __struct.enabled_extensions = buf.get_u8();
20051 __struct.s = buf.get_i16_le();
20052 __struct.t = buf.get_i16_le();
20053 __struct.aux1 = buf.get_i16_le();
20054 __struct.aux2 = buf.get_i16_le();
20055 __struct.aux3 = buf.get_i16_le();
20056 __struct.aux4 = buf.get_i16_le();
20057 __struct.aux5 = buf.get_i16_le();
20058 __struct.aux6 = buf.get_i16_le();
20059 Ok(__struct)
20060 }
20061 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20062 let mut __tmp = BytesMut::new(bytes);
20063 #[allow(clippy::absurd_extreme_comparisons)]
20064 #[allow(unused_comparisons)]
20065 if __tmp.remaining() < Self::ENCODED_LEN {
20066 panic!(
20067 "buffer is too small (need {} bytes, but got {})",
20068 Self::ENCODED_LEN,
20069 __tmp.remaining(),
20070 )
20071 }
20072 __tmp.put_i16_le(self.x);
20073 __tmp.put_i16_le(self.y);
20074 __tmp.put_i16_le(self.z);
20075 __tmp.put_i16_le(self.r);
20076 __tmp.put_u16_le(self.buttons);
20077 __tmp.put_u8(self.target);
20078 if matches!(version, MavlinkVersion::V2) {
20079 __tmp.put_u16_le(self.buttons2);
20080 __tmp.put_u8(self.enabled_extensions);
20081 __tmp.put_i16_le(self.s);
20082 __tmp.put_i16_le(self.t);
20083 __tmp.put_i16_le(self.aux1);
20084 __tmp.put_i16_le(self.aux2);
20085 __tmp.put_i16_le(self.aux3);
20086 __tmp.put_i16_le(self.aux4);
20087 __tmp.put_i16_le(self.aux5);
20088 __tmp.put_i16_le(self.aux6);
20089 let len = __tmp.len();
20090 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20091 } else {
20092 __tmp.len()
20093 }
20094 }
20095}
20096#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
20097#[doc = ""]
20098#[doc = "ID: 81"]
20099#[derive(Debug, Clone, PartialEq)]
20100#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20101#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20102#[cfg_attr(feature = "ts", derive(TS))]
20103#[cfg_attr(feature = "ts", ts(export))]
20104pub struct MANUAL_SETPOINT_DATA {
20105 #[doc = "Timestamp (time since system boot)."]
20106 pub time_boot_ms: u32,
20107 #[doc = "Desired roll rate"]
20108 pub roll: f32,
20109 #[doc = "Desired pitch rate"]
20110 pub pitch: f32,
20111 #[doc = "Desired yaw rate"]
20112 pub yaw: f32,
20113 #[doc = "Collective thrust, normalized to 0 .. 1"]
20114 pub thrust: f32,
20115 #[doc = "Flight mode switch position, 0.. 255"]
20116 pub mode_switch: u8,
20117 #[doc = "Override mode switch position, 0.. 255"]
20118 pub manual_override_switch: u8,
20119}
20120impl MANUAL_SETPOINT_DATA {
20121 pub const ENCODED_LEN: usize = 22usize;
20122 pub const DEFAULT: Self = Self {
20123 time_boot_ms: 0_u32,
20124 roll: 0.0_f32,
20125 pitch: 0.0_f32,
20126 yaw: 0.0_f32,
20127 thrust: 0.0_f32,
20128 mode_switch: 0_u8,
20129 manual_override_switch: 0_u8,
20130 };
20131 #[cfg(feature = "arbitrary")]
20132 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20133 use arbitrary::{Arbitrary, Unstructured};
20134 let mut buf = [0u8; 1024];
20135 rng.fill_bytes(&mut buf);
20136 let mut unstructured = Unstructured::new(&buf);
20137 Self::arbitrary(&mut unstructured).unwrap_or_default()
20138 }
20139}
20140impl Default for MANUAL_SETPOINT_DATA {
20141 fn default() -> Self {
20142 Self::DEFAULT.clone()
20143 }
20144}
20145impl MessageData for MANUAL_SETPOINT_DATA {
20146 type Message = MavMessage;
20147 const ID: u32 = 81u32;
20148 const NAME: &'static str = "MANUAL_SETPOINT";
20149 const EXTRA_CRC: u8 = 106u8;
20150 const ENCODED_LEN: usize = 22usize;
20151 fn deser(
20152 _version: MavlinkVersion,
20153 __input: &[u8],
20154 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20155 let avail_len = __input.len();
20156 let mut payload_buf = [0; Self::ENCODED_LEN];
20157 let mut buf = if avail_len < Self::ENCODED_LEN {
20158 payload_buf[0..avail_len].copy_from_slice(__input);
20159 Bytes::new(&payload_buf)
20160 } else {
20161 Bytes::new(__input)
20162 };
20163 let mut __struct = Self::default();
20164 __struct.time_boot_ms = buf.get_u32_le();
20165 __struct.roll = buf.get_f32_le();
20166 __struct.pitch = buf.get_f32_le();
20167 __struct.yaw = buf.get_f32_le();
20168 __struct.thrust = buf.get_f32_le();
20169 __struct.mode_switch = buf.get_u8();
20170 __struct.manual_override_switch = buf.get_u8();
20171 Ok(__struct)
20172 }
20173 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20174 let mut __tmp = BytesMut::new(bytes);
20175 #[allow(clippy::absurd_extreme_comparisons)]
20176 #[allow(unused_comparisons)]
20177 if __tmp.remaining() < Self::ENCODED_LEN {
20178 panic!(
20179 "buffer is too small (need {} bytes, but got {})",
20180 Self::ENCODED_LEN,
20181 __tmp.remaining(),
20182 )
20183 }
20184 __tmp.put_u32_le(self.time_boot_ms);
20185 __tmp.put_f32_le(self.roll);
20186 __tmp.put_f32_le(self.pitch);
20187 __tmp.put_f32_le(self.yaw);
20188 __tmp.put_f32_le(self.thrust);
20189 __tmp.put_u8(self.mode_switch);
20190 __tmp.put_u8(self.manual_override_switch);
20191 if matches!(version, MavlinkVersion::V2) {
20192 let len = __tmp.len();
20193 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20194 } else {
20195 __tmp.len()
20196 }
20197 }
20198}
20199#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20200#[doc = ""]
20201#[doc = "ID: 249"]
20202#[derive(Debug, Clone, PartialEq)]
20203#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20204#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20205#[cfg_attr(feature = "ts", derive(TS))]
20206#[cfg_attr(feature = "ts", ts(export))]
20207pub struct MEMORY_VECT_DATA {
20208 #[doc = "Starting address of the debug variables"]
20209 pub address: u16,
20210 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
20211 pub ver: u8,
20212 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
20213 pub mavtype: u8,
20214 #[doc = "Memory contents at specified address"]
20215 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20216 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
20217 pub value: [i8; 32],
20218}
20219impl MEMORY_VECT_DATA {
20220 pub const ENCODED_LEN: usize = 36usize;
20221 pub const DEFAULT: Self = Self {
20222 address: 0_u16,
20223 ver: 0_u8,
20224 mavtype: 0_u8,
20225 value: [0_i8; 32usize],
20226 };
20227 #[cfg(feature = "arbitrary")]
20228 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20229 use arbitrary::{Arbitrary, Unstructured};
20230 let mut buf = [0u8; 1024];
20231 rng.fill_bytes(&mut buf);
20232 let mut unstructured = Unstructured::new(&buf);
20233 Self::arbitrary(&mut unstructured).unwrap_or_default()
20234 }
20235}
20236impl Default for MEMORY_VECT_DATA {
20237 fn default() -> Self {
20238 Self::DEFAULT.clone()
20239 }
20240}
20241impl MessageData for MEMORY_VECT_DATA {
20242 type Message = MavMessage;
20243 const ID: u32 = 249u32;
20244 const NAME: &'static str = "MEMORY_VECT";
20245 const EXTRA_CRC: u8 = 204u8;
20246 const ENCODED_LEN: usize = 36usize;
20247 fn deser(
20248 _version: MavlinkVersion,
20249 __input: &[u8],
20250 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20251 let avail_len = __input.len();
20252 let mut payload_buf = [0; Self::ENCODED_LEN];
20253 let mut buf = if avail_len < Self::ENCODED_LEN {
20254 payload_buf[0..avail_len].copy_from_slice(__input);
20255 Bytes::new(&payload_buf)
20256 } else {
20257 Bytes::new(__input)
20258 };
20259 let mut __struct = Self::default();
20260 __struct.address = buf.get_u16_le();
20261 __struct.ver = buf.get_u8();
20262 __struct.mavtype = buf.get_u8();
20263 for v in &mut __struct.value {
20264 let val = buf.get_i8();
20265 *v = val;
20266 }
20267 Ok(__struct)
20268 }
20269 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20270 let mut __tmp = BytesMut::new(bytes);
20271 #[allow(clippy::absurd_extreme_comparisons)]
20272 #[allow(unused_comparisons)]
20273 if __tmp.remaining() < Self::ENCODED_LEN {
20274 panic!(
20275 "buffer is too small (need {} bytes, but got {})",
20276 Self::ENCODED_LEN,
20277 __tmp.remaining(),
20278 )
20279 }
20280 __tmp.put_u16_le(self.address);
20281 __tmp.put_u8(self.ver);
20282 __tmp.put_u8(self.mavtype);
20283 for val in &self.value {
20284 __tmp.put_i8(*val);
20285 }
20286 if matches!(version, MavlinkVersion::V2) {
20287 let len = __tmp.len();
20288 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20289 } else {
20290 __tmp.len()
20291 }
20292 }
20293}
20294#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
20295#[doc = ""]
20296#[doc = "ID: 244"]
20297#[derive(Debug, Clone, PartialEq)]
20298#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20299#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20300#[cfg_attr(feature = "ts", derive(TS))]
20301#[cfg_attr(feature = "ts", ts(export))]
20302pub struct MESSAGE_INTERVAL_DATA {
20303 #[doc = "0 indicates the interval at which it is sent."]
20304 pub interval_us: i32,
20305 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
20306 pub message_id: u16,
20307}
20308impl MESSAGE_INTERVAL_DATA {
20309 pub const ENCODED_LEN: usize = 6usize;
20310 pub const DEFAULT: Self = Self {
20311 interval_us: 0_i32,
20312 message_id: 0_u16,
20313 };
20314 #[cfg(feature = "arbitrary")]
20315 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20316 use arbitrary::{Arbitrary, Unstructured};
20317 let mut buf = [0u8; 1024];
20318 rng.fill_bytes(&mut buf);
20319 let mut unstructured = Unstructured::new(&buf);
20320 Self::arbitrary(&mut unstructured).unwrap_or_default()
20321 }
20322}
20323impl Default for MESSAGE_INTERVAL_DATA {
20324 fn default() -> Self {
20325 Self::DEFAULT.clone()
20326 }
20327}
20328impl MessageData for MESSAGE_INTERVAL_DATA {
20329 type Message = MavMessage;
20330 const ID: u32 = 244u32;
20331 const NAME: &'static str = "MESSAGE_INTERVAL";
20332 const EXTRA_CRC: u8 = 95u8;
20333 const ENCODED_LEN: usize = 6usize;
20334 fn deser(
20335 _version: MavlinkVersion,
20336 __input: &[u8],
20337 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20338 let avail_len = __input.len();
20339 let mut payload_buf = [0; Self::ENCODED_LEN];
20340 let mut buf = if avail_len < Self::ENCODED_LEN {
20341 payload_buf[0..avail_len].copy_from_slice(__input);
20342 Bytes::new(&payload_buf)
20343 } else {
20344 Bytes::new(__input)
20345 };
20346 let mut __struct = Self::default();
20347 __struct.interval_us = buf.get_i32_le();
20348 __struct.message_id = buf.get_u16_le();
20349 Ok(__struct)
20350 }
20351 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20352 let mut __tmp = BytesMut::new(bytes);
20353 #[allow(clippy::absurd_extreme_comparisons)]
20354 #[allow(unused_comparisons)]
20355 if __tmp.remaining() < Self::ENCODED_LEN {
20356 panic!(
20357 "buffer is too small (need {} bytes, but got {})",
20358 Self::ENCODED_LEN,
20359 __tmp.remaining(),
20360 )
20361 }
20362 __tmp.put_i32_le(self.interval_us);
20363 __tmp.put_u16_le(self.message_id);
20364 if matches!(version, MavlinkVersion::V2) {
20365 let len = __tmp.len();
20366 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20367 } else {
20368 __tmp.len()
20369 }
20370 }
20371}
20372#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
20373#[doc = ""]
20374#[doc = "ID: 47"]
20375#[derive(Debug, Clone, PartialEq)]
20376#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20377#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20378#[cfg_attr(feature = "ts", derive(TS))]
20379#[cfg_attr(feature = "ts", ts(export))]
20380pub struct MISSION_ACK_DATA {
20381 #[doc = "System ID"]
20382 pub target_system: u8,
20383 #[doc = "Component ID"]
20384 pub target_component: u8,
20385 #[doc = "Mission result."]
20386 pub mavtype: MavMissionResult,
20387 #[doc = "Mission type."]
20388 #[cfg_attr(feature = "serde", serde(default))]
20389 pub mission_type: MavMissionType,
20390 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
20391 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20392 pub opaque_id: u32,
20393}
20394impl MISSION_ACK_DATA {
20395 pub const ENCODED_LEN: usize = 8usize;
20396 pub const DEFAULT: Self = Self {
20397 target_system: 0_u8,
20398 target_component: 0_u8,
20399 mavtype: MavMissionResult::DEFAULT,
20400 mission_type: MavMissionType::DEFAULT,
20401 opaque_id: 0_u32,
20402 };
20403 #[cfg(feature = "arbitrary")]
20404 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20405 use arbitrary::{Arbitrary, Unstructured};
20406 let mut buf = [0u8; 1024];
20407 rng.fill_bytes(&mut buf);
20408 let mut unstructured = Unstructured::new(&buf);
20409 Self::arbitrary(&mut unstructured).unwrap_or_default()
20410 }
20411}
20412impl Default for MISSION_ACK_DATA {
20413 fn default() -> Self {
20414 Self::DEFAULT.clone()
20415 }
20416}
20417impl MessageData for MISSION_ACK_DATA {
20418 type Message = MavMessage;
20419 const ID: u32 = 47u32;
20420 const NAME: &'static str = "MISSION_ACK";
20421 const EXTRA_CRC: u8 = 153u8;
20422 const ENCODED_LEN: usize = 8usize;
20423 fn deser(
20424 _version: MavlinkVersion,
20425 __input: &[u8],
20426 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20427 let avail_len = __input.len();
20428 let mut payload_buf = [0; Self::ENCODED_LEN];
20429 let mut buf = if avail_len < Self::ENCODED_LEN {
20430 payload_buf[0..avail_len].copy_from_slice(__input);
20431 Bytes::new(&payload_buf)
20432 } else {
20433 Bytes::new(__input)
20434 };
20435 let mut __struct = Self::default();
20436 __struct.target_system = buf.get_u8();
20437 __struct.target_component = buf.get_u8();
20438 let tmp = buf.get_u8();
20439 __struct.mavtype =
20440 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20441 enum_type: "MavMissionResult",
20442 value: tmp as u32,
20443 })?;
20444 let tmp = buf.get_u8();
20445 __struct.mission_type =
20446 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20447 enum_type: "MavMissionType",
20448 value: tmp as u32,
20449 })?;
20450 __struct.opaque_id = buf.get_u32_le();
20451 Ok(__struct)
20452 }
20453 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20454 let mut __tmp = BytesMut::new(bytes);
20455 #[allow(clippy::absurd_extreme_comparisons)]
20456 #[allow(unused_comparisons)]
20457 if __tmp.remaining() < Self::ENCODED_LEN {
20458 panic!(
20459 "buffer is too small (need {} bytes, but got {})",
20460 Self::ENCODED_LEN,
20461 __tmp.remaining(),
20462 )
20463 }
20464 __tmp.put_u8(self.target_system);
20465 __tmp.put_u8(self.target_component);
20466 __tmp.put_u8(self.mavtype as u8);
20467 if matches!(version, MavlinkVersion::V2) {
20468 __tmp.put_u8(self.mission_type as u8);
20469 __tmp.put_u32_le(self.opaque_id);
20470 let len = __tmp.len();
20471 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20472 } else {
20473 __tmp.len()
20474 }
20475 }
20476}
20477#[doc = "Delete all mission items at once."]
20478#[doc = ""]
20479#[doc = "ID: 45"]
20480#[derive(Debug, Clone, PartialEq)]
20481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20483#[cfg_attr(feature = "ts", derive(TS))]
20484#[cfg_attr(feature = "ts", ts(export))]
20485pub struct MISSION_CLEAR_ALL_DATA {
20486 #[doc = "System ID"]
20487 pub target_system: u8,
20488 #[doc = "Component ID"]
20489 pub target_component: u8,
20490 #[doc = "Mission type."]
20491 #[cfg_attr(feature = "serde", serde(default))]
20492 pub mission_type: MavMissionType,
20493}
20494impl MISSION_CLEAR_ALL_DATA {
20495 pub const ENCODED_LEN: usize = 3usize;
20496 pub const DEFAULT: Self = Self {
20497 target_system: 0_u8,
20498 target_component: 0_u8,
20499 mission_type: MavMissionType::DEFAULT,
20500 };
20501 #[cfg(feature = "arbitrary")]
20502 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20503 use arbitrary::{Arbitrary, Unstructured};
20504 let mut buf = [0u8; 1024];
20505 rng.fill_bytes(&mut buf);
20506 let mut unstructured = Unstructured::new(&buf);
20507 Self::arbitrary(&mut unstructured).unwrap_or_default()
20508 }
20509}
20510impl Default for MISSION_CLEAR_ALL_DATA {
20511 fn default() -> Self {
20512 Self::DEFAULT.clone()
20513 }
20514}
20515impl MessageData for MISSION_CLEAR_ALL_DATA {
20516 type Message = MavMessage;
20517 const ID: u32 = 45u32;
20518 const NAME: &'static str = "MISSION_CLEAR_ALL";
20519 const EXTRA_CRC: u8 = 232u8;
20520 const ENCODED_LEN: usize = 3usize;
20521 fn deser(
20522 _version: MavlinkVersion,
20523 __input: &[u8],
20524 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20525 let avail_len = __input.len();
20526 let mut payload_buf = [0; Self::ENCODED_LEN];
20527 let mut buf = if avail_len < Self::ENCODED_LEN {
20528 payload_buf[0..avail_len].copy_from_slice(__input);
20529 Bytes::new(&payload_buf)
20530 } else {
20531 Bytes::new(__input)
20532 };
20533 let mut __struct = Self::default();
20534 __struct.target_system = buf.get_u8();
20535 __struct.target_component = buf.get_u8();
20536 let tmp = buf.get_u8();
20537 __struct.mission_type =
20538 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20539 enum_type: "MavMissionType",
20540 value: tmp as u32,
20541 })?;
20542 Ok(__struct)
20543 }
20544 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20545 let mut __tmp = BytesMut::new(bytes);
20546 #[allow(clippy::absurd_extreme_comparisons)]
20547 #[allow(unused_comparisons)]
20548 if __tmp.remaining() < Self::ENCODED_LEN {
20549 panic!(
20550 "buffer is too small (need {} bytes, but got {})",
20551 Self::ENCODED_LEN,
20552 __tmp.remaining(),
20553 )
20554 }
20555 __tmp.put_u8(self.target_system);
20556 __tmp.put_u8(self.target_component);
20557 if matches!(version, MavlinkVersion::V2) {
20558 __tmp.put_u8(self.mission_type as u8);
20559 let len = __tmp.len();
20560 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20561 } else {
20562 __tmp.len()
20563 }
20564 }
20565}
20566#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
20567#[doc = ""]
20568#[doc = "ID: 44"]
20569#[derive(Debug, Clone, PartialEq)]
20570#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20571#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20572#[cfg_attr(feature = "ts", derive(TS))]
20573#[cfg_attr(feature = "ts", ts(export))]
20574pub struct MISSION_COUNT_DATA {
20575 #[doc = "Number of mission items in the sequence"]
20576 pub count: u16,
20577 #[doc = "System ID"]
20578 pub target_system: u8,
20579 #[doc = "Component ID"]
20580 pub target_component: u8,
20581 #[doc = "Mission type."]
20582 #[cfg_attr(feature = "serde", serde(default))]
20583 pub mission_type: MavMissionType,
20584 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
20585 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20586 pub opaque_id: u32,
20587}
20588impl MISSION_COUNT_DATA {
20589 pub const ENCODED_LEN: usize = 9usize;
20590 pub const DEFAULT: Self = Self {
20591 count: 0_u16,
20592 target_system: 0_u8,
20593 target_component: 0_u8,
20594 mission_type: MavMissionType::DEFAULT,
20595 opaque_id: 0_u32,
20596 };
20597 #[cfg(feature = "arbitrary")]
20598 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20599 use arbitrary::{Arbitrary, Unstructured};
20600 let mut buf = [0u8; 1024];
20601 rng.fill_bytes(&mut buf);
20602 let mut unstructured = Unstructured::new(&buf);
20603 Self::arbitrary(&mut unstructured).unwrap_or_default()
20604 }
20605}
20606impl Default for MISSION_COUNT_DATA {
20607 fn default() -> Self {
20608 Self::DEFAULT.clone()
20609 }
20610}
20611impl MessageData for MISSION_COUNT_DATA {
20612 type Message = MavMessage;
20613 const ID: u32 = 44u32;
20614 const NAME: &'static str = "MISSION_COUNT";
20615 const EXTRA_CRC: u8 = 221u8;
20616 const ENCODED_LEN: usize = 9usize;
20617 fn deser(
20618 _version: MavlinkVersion,
20619 __input: &[u8],
20620 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20621 let avail_len = __input.len();
20622 let mut payload_buf = [0; Self::ENCODED_LEN];
20623 let mut buf = if avail_len < Self::ENCODED_LEN {
20624 payload_buf[0..avail_len].copy_from_slice(__input);
20625 Bytes::new(&payload_buf)
20626 } else {
20627 Bytes::new(__input)
20628 };
20629 let mut __struct = Self::default();
20630 __struct.count = buf.get_u16_le();
20631 __struct.target_system = buf.get_u8();
20632 __struct.target_component = buf.get_u8();
20633 let tmp = buf.get_u8();
20634 __struct.mission_type =
20635 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20636 enum_type: "MavMissionType",
20637 value: tmp as u32,
20638 })?;
20639 __struct.opaque_id = buf.get_u32_le();
20640 Ok(__struct)
20641 }
20642 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20643 let mut __tmp = BytesMut::new(bytes);
20644 #[allow(clippy::absurd_extreme_comparisons)]
20645 #[allow(unused_comparisons)]
20646 if __tmp.remaining() < Self::ENCODED_LEN {
20647 panic!(
20648 "buffer is too small (need {} bytes, but got {})",
20649 Self::ENCODED_LEN,
20650 __tmp.remaining(),
20651 )
20652 }
20653 __tmp.put_u16_le(self.count);
20654 __tmp.put_u8(self.target_system);
20655 __tmp.put_u8(self.target_component);
20656 if matches!(version, MavlinkVersion::V2) {
20657 __tmp.put_u8(self.mission_type as u8);
20658 __tmp.put_u32_le(self.opaque_id);
20659 let len = __tmp.len();
20660 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20661 } else {
20662 __tmp.len()
20663 }
20664 }
20665}
20666#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
20667#[doc = ""]
20668#[doc = "ID: 42"]
20669#[derive(Debug, Clone, PartialEq)]
20670#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20672#[cfg_attr(feature = "ts", derive(TS))]
20673#[cfg_attr(feature = "ts", ts(export))]
20674pub struct MISSION_CURRENT_DATA {
20675 #[doc = "Sequence"]
20676 pub seq: u16,
20677 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
20678 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20679 pub total: u16,
20680 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
20681 #[cfg_attr(feature = "serde", serde(default))]
20682 pub mission_state: MissionState,
20683 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
20684 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20685 pub mission_mode: u8,
20686 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
20687 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20688 pub mission_id: u32,
20689 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
20690 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20691 pub fence_id: u32,
20692 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
20693 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20694 pub rally_points_id: u32,
20695}
20696impl MISSION_CURRENT_DATA {
20697 pub const ENCODED_LEN: usize = 18usize;
20698 pub const DEFAULT: Self = Self {
20699 seq: 0_u16,
20700 total: 0_u16,
20701 mission_state: MissionState::DEFAULT,
20702 mission_mode: 0_u8,
20703 mission_id: 0_u32,
20704 fence_id: 0_u32,
20705 rally_points_id: 0_u32,
20706 };
20707 #[cfg(feature = "arbitrary")]
20708 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20709 use arbitrary::{Arbitrary, Unstructured};
20710 let mut buf = [0u8; 1024];
20711 rng.fill_bytes(&mut buf);
20712 let mut unstructured = Unstructured::new(&buf);
20713 Self::arbitrary(&mut unstructured).unwrap_or_default()
20714 }
20715}
20716impl Default for MISSION_CURRENT_DATA {
20717 fn default() -> Self {
20718 Self::DEFAULT.clone()
20719 }
20720}
20721impl MessageData for MISSION_CURRENT_DATA {
20722 type Message = MavMessage;
20723 const ID: u32 = 42u32;
20724 const NAME: &'static str = "MISSION_CURRENT";
20725 const EXTRA_CRC: u8 = 28u8;
20726 const ENCODED_LEN: usize = 18usize;
20727 fn deser(
20728 _version: MavlinkVersion,
20729 __input: &[u8],
20730 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20731 let avail_len = __input.len();
20732 let mut payload_buf = [0; Self::ENCODED_LEN];
20733 let mut buf = if avail_len < Self::ENCODED_LEN {
20734 payload_buf[0..avail_len].copy_from_slice(__input);
20735 Bytes::new(&payload_buf)
20736 } else {
20737 Bytes::new(__input)
20738 };
20739 let mut __struct = Self::default();
20740 __struct.seq = buf.get_u16_le();
20741 __struct.total = buf.get_u16_le();
20742 let tmp = buf.get_u8();
20743 __struct.mission_state =
20744 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20745 enum_type: "MissionState",
20746 value: tmp as u32,
20747 })?;
20748 __struct.mission_mode = buf.get_u8();
20749 __struct.mission_id = buf.get_u32_le();
20750 __struct.fence_id = buf.get_u32_le();
20751 __struct.rally_points_id = buf.get_u32_le();
20752 Ok(__struct)
20753 }
20754 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20755 let mut __tmp = BytesMut::new(bytes);
20756 #[allow(clippy::absurd_extreme_comparisons)]
20757 #[allow(unused_comparisons)]
20758 if __tmp.remaining() < Self::ENCODED_LEN {
20759 panic!(
20760 "buffer is too small (need {} bytes, but got {})",
20761 Self::ENCODED_LEN,
20762 __tmp.remaining(),
20763 )
20764 }
20765 __tmp.put_u16_le(self.seq);
20766 if matches!(version, MavlinkVersion::V2) {
20767 __tmp.put_u16_le(self.total);
20768 __tmp.put_u8(self.mission_state as u8);
20769 __tmp.put_u8(self.mission_mode);
20770 __tmp.put_u32_le(self.mission_id);
20771 __tmp.put_u32_le(self.fence_id);
20772 __tmp.put_u32_le(self.rally_points_id);
20773 let len = __tmp.len();
20774 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20775 } else {
20776 __tmp.len()
20777 }
20778 }
20779}
20780#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
20781#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20782#[doc = ""]
20783#[doc = "ID: 39"]
20784#[derive(Debug, Clone, PartialEq)]
20785#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20786#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20787#[cfg_attr(feature = "ts", derive(TS))]
20788#[cfg_attr(feature = "ts", ts(export))]
20789pub struct MISSION_ITEM_DATA {
20790 #[doc = "PARAM1, see MAV_CMD enum"]
20791 pub param1: f32,
20792 #[doc = "PARAM2, see MAV_CMD enum"]
20793 pub param2: f32,
20794 #[doc = "PARAM3, see MAV_CMD enum"]
20795 pub param3: f32,
20796 #[doc = "PARAM4, see MAV_CMD enum"]
20797 pub param4: f32,
20798 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
20799 pub x: f32,
20800 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
20801 pub y: f32,
20802 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
20803 pub z: f32,
20804 #[doc = "Sequence"]
20805 pub seq: u16,
20806 #[doc = "The scheduled action for the waypoint."]
20807 pub command: MavCmd,
20808 #[doc = "System ID"]
20809 pub target_system: u8,
20810 #[doc = "Component ID"]
20811 pub target_component: u8,
20812 #[doc = "The coordinate system of the waypoint."]
20813 pub frame: MavFrame,
20814 #[doc = "false:0, true:1"]
20815 pub current: u8,
20816 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20817 pub autocontinue: u8,
20818 #[doc = "Mission type."]
20819 #[cfg_attr(feature = "serde", serde(default))]
20820 pub mission_type: MavMissionType,
20821}
20822impl MISSION_ITEM_DATA {
20823 pub const ENCODED_LEN: usize = 38usize;
20824 pub const DEFAULT: Self = Self {
20825 param1: 0.0_f32,
20826 param2: 0.0_f32,
20827 param3: 0.0_f32,
20828 param4: 0.0_f32,
20829 x: 0.0_f32,
20830 y: 0.0_f32,
20831 z: 0.0_f32,
20832 seq: 0_u16,
20833 command: MavCmd::DEFAULT,
20834 target_system: 0_u8,
20835 target_component: 0_u8,
20836 frame: MavFrame::DEFAULT,
20837 current: 0_u8,
20838 autocontinue: 0_u8,
20839 mission_type: MavMissionType::DEFAULT,
20840 };
20841 #[cfg(feature = "arbitrary")]
20842 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20843 use arbitrary::{Arbitrary, Unstructured};
20844 let mut buf = [0u8; 1024];
20845 rng.fill_bytes(&mut buf);
20846 let mut unstructured = Unstructured::new(&buf);
20847 Self::arbitrary(&mut unstructured).unwrap_or_default()
20848 }
20849}
20850impl Default for MISSION_ITEM_DATA {
20851 fn default() -> Self {
20852 Self::DEFAULT.clone()
20853 }
20854}
20855impl MessageData for MISSION_ITEM_DATA {
20856 type Message = MavMessage;
20857 const ID: u32 = 39u32;
20858 const NAME: &'static str = "MISSION_ITEM";
20859 const EXTRA_CRC: u8 = 254u8;
20860 const ENCODED_LEN: usize = 38usize;
20861 fn deser(
20862 _version: MavlinkVersion,
20863 __input: &[u8],
20864 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20865 let avail_len = __input.len();
20866 let mut payload_buf = [0; Self::ENCODED_LEN];
20867 let mut buf = if avail_len < Self::ENCODED_LEN {
20868 payload_buf[0..avail_len].copy_from_slice(__input);
20869 Bytes::new(&payload_buf)
20870 } else {
20871 Bytes::new(__input)
20872 };
20873 let mut __struct = Self::default();
20874 __struct.param1 = buf.get_f32_le();
20875 __struct.param2 = buf.get_f32_le();
20876 __struct.param3 = buf.get_f32_le();
20877 __struct.param4 = buf.get_f32_le();
20878 __struct.x = buf.get_f32_le();
20879 __struct.y = buf.get_f32_le();
20880 __struct.z = buf.get_f32_le();
20881 __struct.seq = buf.get_u16_le();
20882 let tmp = buf.get_u16_le();
20883 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20884 ::mavlink_core::error::ParserError::InvalidEnum {
20885 enum_type: "MavCmd",
20886 value: tmp as u32,
20887 },
20888 )?;
20889 __struct.target_system = buf.get_u8();
20890 __struct.target_component = buf.get_u8();
20891 let tmp = buf.get_u8();
20892 __struct.frame =
20893 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20894 enum_type: "MavFrame",
20895 value: tmp as u32,
20896 })?;
20897 __struct.current = buf.get_u8();
20898 __struct.autocontinue = buf.get_u8();
20899 let tmp = buf.get_u8();
20900 __struct.mission_type =
20901 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20902 enum_type: "MavMissionType",
20903 value: tmp as u32,
20904 })?;
20905 Ok(__struct)
20906 }
20907 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20908 let mut __tmp = BytesMut::new(bytes);
20909 #[allow(clippy::absurd_extreme_comparisons)]
20910 #[allow(unused_comparisons)]
20911 if __tmp.remaining() < Self::ENCODED_LEN {
20912 panic!(
20913 "buffer is too small (need {} bytes, but got {})",
20914 Self::ENCODED_LEN,
20915 __tmp.remaining(),
20916 )
20917 }
20918 __tmp.put_f32_le(self.param1);
20919 __tmp.put_f32_le(self.param2);
20920 __tmp.put_f32_le(self.param3);
20921 __tmp.put_f32_le(self.param4);
20922 __tmp.put_f32_le(self.x);
20923 __tmp.put_f32_le(self.y);
20924 __tmp.put_f32_le(self.z);
20925 __tmp.put_u16_le(self.seq);
20926 __tmp.put_u16_le(self.command as u16);
20927 __tmp.put_u8(self.target_system);
20928 __tmp.put_u8(self.target_component);
20929 __tmp.put_u8(self.frame as u8);
20930 __tmp.put_u8(self.current);
20931 __tmp.put_u8(self.autocontinue);
20932 if matches!(version, MavlinkVersion::V2) {
20933 __tmp.put_u8(self.mission_type as u8);
20934 let len = __tmp.len();
20935 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20936 } else {
20937 __tmp.len()
20938 }
20939 }
20940}
20941#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20942#[doc = ""]
20943#[doc = "ID: 73"]
20944#[derive(Debug, Clone, PartialEq)]
20945#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20946#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20947#[cfg_attr(feature = "ts", derive(TS))]
20948#[cfg_attr(feature = "ts", ts(export))]
20949pub struct MISSION_ITEM_INT_DATA {
20950 #[doc = "PARAM1, see MAV_CMD enum"]
20951 pub param1: f32,
20952 #[doc = "PARAM2, see MAV_CMD enum"]
20953 pub param2: f32,
20954 #[doc = "PARAM3, see MAV_CMD enum"]
20955 pub param3: f32,
20956 #[doc = "PARAM4, see MAV_CMD enum"]
20957 pub param4: f32,
20958 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
20959 pub x: i32,
20960 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
20961 pub y: i32,
20962 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
20963 pub z: f32,
20964 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
20965 pub seq: u16,
20966 #[doc = "The scheduled action for the waypoint."]
20967 pub command: MavCmd,
20968 #[doc = "System ID"]
20969 pub target_system: u8,
20970 #[doc = "Component ID"]
20971 pub target_component: u8,
20972 #[doc = "The coordinate system of the waypoint."]
20973 pub frame: MavFrame,
20974 #[doc = "false:0, true:1"]
20975 pub current: u8,
20976 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20977 pub autocontinue: u8,
20978 #[doc = "Mission type."]
20979 #[cfg_attr(feature = "serde", serde(default))]
20980 pub mission_type: MavMissionType,
20981}
20982impl MISSION_ITEM_INT_DATA {
20983 pub const ENCODED_LEN: usize = 38usize;
20984 pub const DEFAULT: Self = Self {
20985 param1: 0.0_f32,
20986 param2: 0.0_f32,
20987 param3: 0.0_f32,
20988 param4: 0.0_f32,
20989 x: 0_i32,
20990 y: 0_i32,
20991 z: 0.0_f32,
20992 seq: 0_u16,
20993 command: MavCmd::DEFAULT,
20994 target_system: 0_u8,
20995 target_component: 0_u8,
20996 frame: MavFrame::DEFAULT,
20997 current: 0_u8,
20998 autocontinue: 0_u8,
20999 mission_type: MavMissionType::DEFAULT,
21000 };
21001 #[cfg(feature = "arbitrary")]
21002 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21003 use arbitrary::{Arbitrary, Unstructured};
21004 let mut buf = [0u8; 1024];
21005 rng.fill_bytes(&mut buf);
21006 let mut unstructured = Unstructured::new(&buf);
21007 Self::arbitrary(&mut unstructured).unwrap_or_default()
21008 }
21009}
21010impl Default for MISSION_ITEM_INT_DATA {
21011 fn default() -> Self {
21012 Self::DEFAULT.clone()
21013 }
21014}
21015impl MessageData for MISSION_ITEM_INT_DATA {
21016 type Message = MavMessage;
21017 const ID: u32 = 73u32;
21018 const NAME: &'static str = "MISSION_ITEM_INT";
21019 const EXTRA_CRC: u8 = 38u8;
21020 const ENCODED_LEN: usize = 38usize;
21021 fn deser(
21022 _version: MavlinkVersion,
21023 __input: &[u8],
21024 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21025 let avail_len = __input.len();
21026 let mut payload_buf = [0; Self::ENCODED_LEN];
21027 let mut buf = if avail_len < Self::ENCODED_LEN {
21028 payload_buf[0..avail_len].copy_from_slice(__input);
21029 Bytes::new(&payload_buf)
21030 } else {
21031 Bytes::new(__input)
21032 };
21033 let mut __struct = Self::default();
21034 __struct.param1 = buf.get_f32_le();
21035 __struct.param2 = buf.get_f32_le();
21036 __struct.param3 = buf.get_f32_le();
21037 __struct.param4 = buf.get_f32_le();
21038 __struct.x = buf.get_i32_le();
21039 __struct.y = buf.get_i32_le();
21040 __struct.z = buf.get_f32_le();
21041 __struct.seq = buf.get_u16_le();
21042 let tmp = buf.get_u16_le();
21043 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
21044 ::mavlink_core::error::ParserError::InvalidEnum {
21045 enum_type: "MavCmd",
21046 value: tmp as u32,
21047 },
21048 )?;
21049 __struct.target_system = buf.get_u8();
21050 __struct.target_component = buf.get_u8();
21051 let tmp = buf.get_u8();
21052 __struct.frame =
21053 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21054 enum_type: "MavFrame",
21055 value: tmp as u32,
21056 })?;
21057 __struct.current = buf.get_u8();
21058 __struct.autocontinue = buf.get_u8();
21059 let tmp = buf.get_u8();
21060 __struct.mission_type =
21061 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21062 enum_type: "MavMissionType",
21063 value: tmp as u32,
21064 })?;
21065 Ok(__struct)
21066 }
21067 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21068 let mut __tmp = BytesMut::new(bytes);
21069 #[allow(clippy::absurd_extreme_comparisons)]
21070 #[allow(unused_comparisons)]
21071 if __tmp.remaining() < Self::ENCODED_LEN {
21072 panic!(
21073 "buffer is too small (need {} bytes, but got {})",
21074 Self::ENCODED_LEN,
21075 __tmp.remaining(),
21076 )
21077 }
21078 __tmp.put_f32_le(self.param1);
21079 __tmp.put_f32_le(self.param2);
21080 __tmp.put_f32_le(self.param3);
21081 __tmp.put_f32_le(self.param4);
21082 __tmp.put_i32_le(self.x);
21083 __tmp.put_i32_le(self.y);
21084 __tmp.put_f32_le(self.z);
21085 __tmp.put_u16_le(self.seq);
21086 __tmp.put_u16_le(self.command as u16);
21087 __tmp.put_u8(self.target_system);
21088 __tmp.put_u8(self.target_component);
21089 __tmp.put_u8(self.frame as u8);
21090 __tmp.put_u8(self.current);
21091 __tmp.put_u8(self.autocontinue);
21092 if matches!(version, MavlinkVersion::V2) {
21093 __tmp.put_u8(self.mission_type as u8);
21094 let len = __tmp.len();
21095 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21096 } else {
21097 __tmp.len()
21098 }
21099 }
21100}
21101#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
21102#[doc = ""]
21103#[doc = "ID: 46"]
21104#[derive(Debug, Clone, PartialEq)]
21105#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21107#[cfg_attr(feature = "ts", derive(TS))]
21108#[cfg_attr(feature = "ts", ts(export))]
21109pub struct MISSION_ITEM_REACHED_DATA {
21110 #[doc = "Sequence"]
21111 pub seq: u16,
21112}
21113impl MISSION_ITEM_REACHED_DATA {
21114 pub const ENCODED_LEN: usize = 2usize;
21115 pub const DEFAULT: Self = Self { seq: 0_u16 };
21116 #[cfg(feature = "arbitrary")]
21117 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21118 use arbitrary::{Arbitrary, Unstructured};
21119 let mut buf = [0u8; 1024];
21120 rng.fill_bytes(&mut buf);
21121 let mut unstructured = Unstructured::new(&buf);
21122 Self::arbitrary(&mut unstructured).unwrap_or_default()
21123 }
21124}
21125impl Default for MISSION_ITEM_REACHED_DATA {
21126 fn default() -> Self {
21127 Self::DEFAULT.clone()
21128 }
21129}
21130impl MessageData for MISSION_ITEM_REACHED_DATA {
21131 type Message = MavMessage;
21132 const ID: u32 = 46u32;
21133 const NAME: &'static str = "MISSION_ITEM_REACHED";
21134 const EXTRA_CRC: u8 = 11u8;
21135 const ENCODED_LEN: usize = 2usize;
21136 fn deser(
21137 _version: MavlinkVersion,
21138 __input: &[u8],
21139 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21140 let avail_len = __input.len();
21141 let mut payload_buf = [0; Self::ENCODED_LEN];
21142 let mut buf = if avail_len < Self::ENCODED_LEN {
21143 payload_buf[0..avail_len].copy_from_slice(__input);
21144 Bytes::new(&payload_buf)
21145 } else {
21146 Bytes::new(__input)
21147 };
21148 let mut __struct = Self::default();
21149 __struct.seq = buf.get_u16_le();
21150 Ok(__struct)
21151 }
21152 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21153 let mut __tmp = BytesMut::new(bytes);
21154 #[allow(clippy::absurd_extreme_comparisons)]
21155 #[allow(unused_comparisons)]
21156 if __tmp.remaining() < Self::ENCODED_LEN {
21157 panic!(
21158 "buffer is too small (need {} bytes, but got {})",
21159 Self::ENCODED_LEN,
21160 __tmp.remaining(),
21161 )
21162 }
21163 __tmp.put_u16_le(self.seq);
21164 if matches!(version, MavlinkVersion::V2) {
21165 let len = __tmp.len();
21166 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21167 } else {
21168 __tmp.len()
21169 }
21170 }
21171}
21172#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
21173#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
21174#[doc = ""]
21175#[doc = "ID: 40"]
21176#[derive(Debug, Clone, PartialEq)]
21177#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21178#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21179#[cfg_attr(feature = "ts", derive(TS))]
21180#[cfg_attr(feature = "ts", ts(export))]
21181pub struct MISSION_REQUEST_DATA {
21182 #[doc = "Sequence"]
21183 pub seq: u16,
21184 #[doc = "System ID"]
21185 pub target_system: u8,
21186 #[doc = "Component ID"]
21187 pub target_component: u8,
21188 #[doc = "Mission type."]
21189 #[cfg_attr(feature = "serde", serde(default))]
21190 pub mission_type: MavMissionType,
21191}
21192impl MISSION_REQUEST_DATA {
21193 pub const ENCODED_LEN: usize = 5usize;
21194 pub const DEFAULT: Self = Self {
21195 seq: 0_u16,
21196 target_system: 0_u8,
21197 target_component: 0_u8,
21198 mission_type: MavMissionType::DEFAULT,
21199 };
21200 #[cfg(feature = "arbitrary")]
21201 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21202 use arbitrary::{Arbitrary, Unstructured};
21203 let mut buf = [0u8; 1024];
21204 rng.fill_bytes(&mut buf);
21205 let mut unstructured = Unstructured::new(&buf);
21206 Self::arbitrary(&mut unstructured).unwrap_or_default()
21207 }
21208}
21209impl Default for MISSION_REQUEST_DATA {
21210 fn default() -> Self {
21211 Self::DEFAULT.clone()
21212 }
21213}
21214impl MessageData for MISSION_REQUEST_DATA {
21215 type Message = MavMessage;
21216 const ID: u32 = 40u32;
21217 const NAME: &'static str = "MISSION_REQUEST";
21218 const EXTRA_CRC: u8 = 230u8;
21219 const ENCODED_LEN: usize = 5usize;
21220 fn deser(
21221 _version: MavlinkVersion,
21222 __input: &[u8],
21223 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21224 let avail_len = __input.len();
21225 let mut payload_buf = [0; Self::ENCODED_LEN];
21226 let mut buf = if avail_len < Self::ENCODED_LEN {
21227 payload_buf[0..avail_len].copy_from_slice(__input);
21228 Bytes::new(&payload_buf)
21229 } else {
21230 Bytes::new(__input)
21231 };
21232 let mut __struct = Self::default();
21233 __struct.seq = buf.get_u16_le();
21234 __struct.target_system = buf.get_u8();
21235 __struct.target_component = buf.get_u8();
21236 let tmp = buf.get_u8();
21237 __struct.mission_type =
21238 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21239 enum_type: "MavMissionType",
21240 value: tmp as u32,
21241 })?;
21242 Ok(__struct)
21243 }
21244 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21245 let mut __tmp = BytesMut::new(bytes);
21246 #[allow(clippy::absurd_extreme_comparisons)]
21247 #[allow(unused_comparisons)]
21248 if __tmp.remaining() < Self::ENCODED_LEN {
21249 panic!(
21250 "buffer is too small (need {} bytes, but got {})",
21251 Self::ENCODED_LEN,
21252 __tmp.remaining(),
21253 )
21254 }
21255 __tmp.put_u16_le(self.seq);
21256 __tmp.put_u8(self.target_system);
21257 __tmp.put_u8(self.target_component);
21258 if matches!(version, MavlinkVersion::V2) {
21259 __tmp.put_u8(self.mission_type as u8);
21260 let len = __tmp.len();
21261 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21262 } else {
21263 __tmp.len()
21264 }
21265 }
21266}
21267#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
21268#[doc = ""]
21269#[doc = "ID: 51"]
21270#[derive(Debug, Clone, PartialEq)]
21271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21273#[cfg_attr(feature = "ts", derive(TS))]
21274#[cfg_attr(feature = "ts", ts(export))]
21275pub struct MISSION_REQUEST_INT_DATA {
21276 #[doc = "Sequence"]
21277 pub seq: u16,
21278 #[doc = "System ID"]
21279 pub target_system: u8,
21280 #[doc = "Component ID"]
21281 pub target_component: u8,
21282 #[doc = "Mission type."]
21283 #[cfg_attr(feature = "serde", serde(default))]
21284 pub mission_type: MavMissionType,
21285}
21286impl MISSION_REQUEST_INT_DATA {
21287 pub const ENCODED_LEN: usize = 5usize;
21288 pub const DEFAULT: Self = Self {
21289 seq: 0_u16,
21290 target_system: 0_u8,
21291 target_component: 0_u8,
21292 mission_type: MavMissionType::DEFAULT,
21293 };
21294 #[cfg(feature = "arbitrary")]
21295 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21296 use arbitrary::{Arbitrary, Unstructured};
21297 let mut buf = [0u8; 1024];
21298 rng.fill_bytes(&mut buf);
21299 let mut unstructured = Unstructured::new(&buf);
21300 Self::arbitrary(&mut unstructured).unwrap_or_default()
21301 }
21302}
21303impl Default for MISSION_REQUEST_INT_DATA {
21304 fn default() -> Self {
21305 Self::DEFAULT.clone()
21306 }
21307}
21308impl MessageData for MISSION_REQUEST_INT_DATA {
21309 type Message = MavMessage;
21310 const ID: u32 = 51u32;
21311 const NAME: &'static str = "MISSION_REQUEST_INT";
21312 const EXTRA_CRC: u8 = 196u8;
21313 const ENCODED_LEN: usize = 5usize;
21314 fn deser(
21315 _version: MavlinkVersion,
21316 __input: &[u8],
21317 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21318 let avail_len = __input.len();
21319 let mut payload_buf = [0; Self::ENCODED_LEN];
21320 let mut buf = if avail_len < Self::ENCODED_LEN {
21321 payload_buf[0..avail_len].copy_from_slice(__input);
21322 Bytes::new(&payload_buf)
21323 } else {
21324 Bytes::new(__input)
21325 };
21326 let mut __struct = Self::default();
21327 __struct.seq = buf.get_u16_le();
21328 __struct.target_system = buf.get_u8();
21329 __struct.target_component = buf.get_u8();
21330 let tmp = buf.get_u8();
21331 __struct.mission_type =
21332 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21333 enum_type: "MavMissionType",
21334 value: tmp as u32,
21335 })?;
21336 Ok(__struct)
21337 }
21338 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21339 let mut __tmp = BytesMut::new(bytes);
21340 #[allow(clippy::absurd_extreme_comparisons)]
21341 #[allow(unused_comparisons)]
21342 if __tmp.remaining() < Self::ENCODED_LEN {
21343 panic!(
21344 "buffer is too small (need {} bytes, but got {})",
21345 Self::ENCODED_LEN,
21346 __tmp.remaining(),
21347 )
21348 }
21349 __tmp.put_u16_le(self.seq);
21350 __tmp.put_u8(self.target_system);
21351 __tmp.put_u8(self.target_component);
21352 if matches!(version, MavlinkVersion::V2) {
21353 __tmp.put_u8(self.mission_type as u8);
21354 let len = __tmp.len();
21355 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21356 } else {
21357 __tmp.len()
21358 }
21359 }
21360}
21361#[doc = "Request the overall list of mission items from the system/component."]
21362#[doc = ""]
21363#[doc = "ID: 43"]
21364#[derive(Debug, Clone, PartialEq)]
21365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21367#[cfg_attr(feature = "ts", derive(TS))]
21368#[cfg_attr(feature = "ts", ts(export))]
21369pub struct MISSION_REQUEST_LIST_DATA {
21370 #[doc = "System ID"]
21371 pub target_system: u8,
21372 #[doc = "Component ID"]
21373 pub target_component: u8,
21374 #[doc = "Mission type."]
21375 #[cfg_attr(feature = "serde", serde(default))]
21376 pub mission_type: MavMissionType,
21377}
21378impl MISSION_REQUEST_LIST_DATA {
21379 pub const ENCODED_LEN: usize = 3usize;
21380 pub const DEFAULT: Self = Self {
21381 target_system: 0_u8,
21382 target_component: 0_u8,
21383 mission_type: MavMissionType::DEFAULT,
21384 };
21385 #[cfg(feature = "arbitrary")]
21386 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21387 use arbitrary::{Arbitrary, Unstructured};
21388 let mut buf = [0u8; 1024];
21389 rng.fill_bytes(&mut buf);
21390 let mut unstructured = Unstructured::new(&buf);
21391 Self::arbitrary(&mut unstructured).unwrap_or_default()
21392 }
21393}
21394impl Default for MISSION_REQUEST_LIST_DATA {
21395 fn default() -> Self {
21396 Self::DEFAULT.clone()
21397 }
21398}
21399impl MessageData for MISSION_REQUEST_LIST_DATA {
21400 type Message = MavMessage;
21401 const ID: u32 = 43u32;
21402 const NAME: &'static str = "MISSION_REQUEST_LIST";
21403 const EXTRA_CRC: u8 = 132u8;
21404 const ENCODED_LEN: usize = 3usize;
21405 fn deser(
21406 _version: MavlinkVersion,
21407 __input: &[u8],
21408 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21409 let avail_len = __input.len();
21410 let mut payload_buf = [0; Self::ENCODED_LEN];
21411 let mut buf = if avail_len < Self::ENCODED_LEN {
21412 payload_buf[0..avail_len].copy_from_slice(__input);
21413 Bytes::new(&payload_buf)
21414 } else {
21415 Bytes::new(__input)
21416 };
21417 let mut __struct = Self::default();
21418 __struct.target_system = buf.get_u8();
21419 __struct.target_component = buf.get_u8();
21420 let tmp = buf.get_u8();
21421 __struct.mission_type =
21422 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21423 enum_type: "MavMissionType",
21424 value: tmp as u32,
21425 })?;
21426 Ok(__struct)
21427 }
21428 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21429 let mut __tmp = BytesMut::new(bytes);
21430 #[allow(clippy::absurd_extreme_comparisons)]
21431 #[allow(unused_comparisons)]
21432 if __tmp.remaining() < Self::ENCODED_LEN {
21433 panic!(
21434 "buffer is too small (need {} bytes, but got {})",
21435 Self::ENCODED_LEN,
21436 __tmp.remaining(),
21437 )
21438 }
21439 __tmp.put_u8(self.target_system);
21440 __tmp.put_u8(self.target_component);
21441 if matches!(version, MavlinkVersion::V2) {
21442 __tmp.put_u8(self.mission_type as u8);
21443 let len = __tmp.len();
21444 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21445 } else {
21446 __tmp.len()
21447 }
21448 }
21449}
21450#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
21451#[doc = ""]
21452#[doc = "ID: 37"]
21453#[derive(Debug, Clone, PartialEq)]
21454#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21455#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21456#[cfg_attr(feature = "ts", derive(TS))]
21457#[cfg_attr(feature = "ts", ts(export))]
21458pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
21459 #[doc = "Start index"]
21460 pub start_index: i16,
21461 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
21462 pub end_index: i16,
21463 #[doc = "System ID"]
21464 pub target_system: u8,
21465 #[doc = "Component ID"]
21466 pub target_component: u8,
21467 #[doc = "Mission type."]
21468 #[cfg_attr(feature = "serde", serde(default))]
21469 pub mission_type: MavMissionType,
21470}
21471impl MISSION_REQUEST_PARTIAL_LIST_DATA {
21472 pub const ENCODED_LEN: usize = 7usize;
21473 pub const DEFAULT: Self = Self {
21474 start_index: 0_i16,
21475 end_index: 0_i16,
21476 target_system: 0_u8,
21477 target_component: 0_u8,
21478 mission_type: MavMissionType::DEFAULT,
21479 };
21480 #[cfg(feature = "arbitrary")]
21481 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21482 use arbitrary::{Arbitrary, Unstructured};
21483 let mut buf = [0u8; 1024];
21484 rng.fill_bytes(&mut buf);
21485 let mut unstructured = Unstructured::new(&buf);
21486 Self::arbitrary(&mut unstructured).unwrap_or_default()
21487 }
21488}
21489impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
21490 fn default() -> Self {
21491 Self::DEFAULT.clone()
21492 }
21493}
21494impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
21495 type Message = MavMessage;
21496 const ID: u32 = 37u32;
21497 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
21498 const EXTRA_CRC: u8 = 212u8;
21499 const ENCODED_LEN: usize = 7usize;
21500 fn deser(
21501 _version: MavlinkVersion,
21502 __input: &[u8],
21503 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21504 let avail_len = __input.len();
21505 let mut payload_buf = [0; Self::ENCODED_LEN];
21506 let mut buf = if avail_len < Self::ENCODED_LEN {
21507 payload_buf[0..avail_len].copy_from_slice(__input);
21508 Bytes::new(&payload_buf)
21509 } else {
21510 Bytes::new(__input)
21511 };
21512 let mut __struct = Self::default();
21513 __struct.start_index = buf.get_i16_le();
21514 __struct.end_index = buf.get_i16_le();
21515 __struct.target_system = buf.get_u8();
21516 __struct.target_component = buf.get_u8();
21517 let tmp = buf.get_u8();
21518 __struct.mission_type =
21519 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21520 enum_type: "MavMissionType",
21521 value: tmp as u32,
21522 })?;
21523 Ok(__struct)
21524 }
21525 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21526 let mut __tmp = BytesMut::new(bytes);
21527 #[allow(clippy::absurd_extreme_comparisons)]
21528 #[allow(unused_comparisons)]
21529 if __tmp.remaining() < Self::ENCODED_LEN {
21530 panic!(
21531 "buffer is too small (need {} bytes, but got {})",
21532 Self::ENCODED_LEN,
21533 __tmp.remaining(),
21534 )
21535 }
21536 __tmp.put_i16_le(self.start_index);
21537 __tmp.put_i16_le(self.end_index);
21538 __tmp.put_u8(self.target_system);
21539 __tmp.put_u8(self.target_component);
21540 if matches!(version, MavlinkVersion::V2) {
21541 __tmp.put_u8(self.mission_type as u8);
21542 let len = __tmp.len();
21543 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21544 } else {
21545 __tmp.len()
21546 }
21547 }
21548}
21549#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
21550#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
21551#[doc = ""]
21552#[doc = "ID: 41"]
21553#[derive(Debug, Clone, PartialEq)]
21554#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21555#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21556#[cfg_attr(feature = "ts", derive(TS))]
21557#[cfg_attr(feature = "ts", ts(export))]
21558pub struct MISSION_SET_CURRENT_DATA {
21559 #[doc = "Sequence"]
21560 pub seq: u16,
21561 #[doc = "System ID"]
21562 pub target_system: u8,
21563 #[doc = "Component ID"]
21564 pub target_component: u8,
21565}
21566impl MISSION_SET_CURRENT_DATA {
21567 pub const ENCODED_LEN: usize = 4usize;
21568 pub const DEFAULT: Self = Self {
21569 seq: 0_u16,
21570 target_system: 0_u8,
21571 target_component: 0_u8,
21572 };
21573 #[cfg(feature = "arbitrary")]
21574 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21575 use arbitrary::{Arbitrary, Unstructured};
21576 let mut buf = [0u8; 1024];
21577 rng.fill_bytes(&mut buf);
21578 let mut unstructured = Unstructured::new(&buf);
21579 Self::arbitrary(&mut unstructured).unwrap_or_default()
21580 }
21581}
21582impl Default for MISSION_SET_CURRENT_DATA {
21583 fn default() -> Self {
21584 Self::DEFAULT.clone()
21585 }
21586}
21587impl MessageData for MISSION_SET_CURRENT_DATA {
21588 type Message = MavMessage;
21589 const ID: u32 = 41u32;
21590 const NAME: &'static str = "MISSION_SET_CURRENT";
21591 const EXTRA_CRC: u8 = 28u8;
21592 const ENCODED_LEN: usize = 4usize;
21593 fn deser(
21594 _version: MavlinkVersion,
21595 __input: &[u8],
21596 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21597 let avail_len = __input.len();
21598 let mut payload_buf = [0; Self::ENCODED_LEN];
21599 let mut buf = if avail_len < Self::ENCODED_LEN {
21600 payload_buf[0..avail_len].copy_from_slice(__input);
21601 Bytes::new(&payload_buf)
21602 } else {
21603 Bytes::new(__input)
21604 };
21605 let mut __struct = Self::default();
21606 __struct.seq = buf.get_u16_le();
21607 __struct.target_system = buf.get_u8();
21608 __struct.target_component = buf.get_u8();
21609 Ok(__struct)
21610 }
21611 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21612 let mut __tmp = BytesMut::new(bytes);
21613 #[allow(clippy::absurd_extreme_comparisons)]
21614 #[allow(unused_comparisons)]
21615 if __tmp.remaining() < Self::ENCODED_LEN {
21616 panic!(
21617 "buffer is too small (need {} bytes, but got {})",
21618 Self::ENCODED_LEN,
21619 __tmp.remaining(),
21620 )
21621 }
21622 __tmp.put_u16_le(self.seq);
21623 __tmp.put_u8(self.target_system);
21624 __tmp.put_u8(self.target_component);
21625 if matches!(version, MavlinkVersion::V2) {
21626 let len = __tmp.len();
21627 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21628 } else {
21629 __tmp.len()
21630 }
21631 }
21632}
21633#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
21634#[doc = ""]
21635#[doc = "ID: 38"]
21636#[derive(Debug, Clone, PartialEq)]
21637#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21638#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21639#[cfg_attr(feature = "ts", derive(TS))]
21640#[cfg_attr(feature = "ts", ts(export))]
21641pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
21642 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
21643 pub start_index: i16,
21644 #[doc = "End index, equal or greater than start index."]
21645 pub end_index: i16,
21646 #[doc = "System ID"]
21647 pub target_system: u8,
21648 #[doc = "Component ID"]
21649 pub target_component: u8,
21650 #[doc = "Mission type."]
21651 #[cfg_attr(feature = "serde", serde(default))]
21652 pub mission_type: MavMissionType,
21653}
21654impl MISSION_WRITE_PARTIAL_LIST_DATA {
21655 pub const ENCODED_LEN: usize = 7usize;
21656 pub const DEFAULT: Self = Self {
21657 start_index: 0_i16,
21658 end_index: 0_i16,
21659 target_system: 0_u8,
21660 target_component: 0_u8,
21661 mission_type: MavMissionType::DEFAULT,
21662 };
21663 #[cfg(feature = "arbitrary")]
21664 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21665 use arbitrary::{Arbitrary, Unstructured};
21666 let mut buf = [0u8; 1024];
21667 rng.fill_bytes(&mut buf);
21668 let mut unstructured = Unstructured::new(&buf);
21669 Self::arbitrary(&mut unstructured).unwrap_or_default()
21670 }
21671}
21672impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
21673 fn default() -> Self {
21674 Self::DEFAULT.clone()
21675 }
21676}
21677impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
21678 type Message = MavMessage;
21679 const ID: u32 = 38u32;
21680 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
21681 const EXTRA_CRC: u8 = 9u8;
21682 const ENCODED_LEN: usize = 7usize;
21683 fn deser(
21684 _version: MavlinkVersion,
21685 __input: &[u8],
21686 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21687 let avail_len = __input.len();
21688 let mut payload_buf = [0; Self::ENCODED_LEN];
21689 let mut buf = if avail_len < Self::ENCODED_LEN {
21690 payload_buf[0..avail_len].copy_from_slice(__input);
21691 Bytes::new(&payload_buf)
21692 } else {
21693 Bytes::new(__input)
21694 };
21695 let mut __struct = Self::default();
21696 __struct.start_index = buf.get_i16_le();
21697 __struct.end_index = buf.get_i16_le();
21698 __struct.target_system = buf.get_u8();
21699 __struct.target_component = buf.get_u8();
21700 let tmp = buf.get_u8();
21701 __struct.mission_type =
21702 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21703 enum_type: "MavMissionType",
21704 value: tmp as u32,
21705 })?;
21706 Ok(__struct)
21707 }
21708 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21709 let mut __tmp = BytesMut::new(bytes);
21710 #[allow(clippy::absurd_extreme_comparisons)]
21711 #[allow(unused_comparisons)]
21712 if __tmp.remaining() < Self::ENCODED_LEN {
21713 panic!(
21714 "buffer is too small (need {} bytes, but got {})",
21715 Self::ENCODED_LEN,
21716 __tmp.remaining(),
21717 )
21718 }
21719 __tmp.put_i16_le(self.start_index);
21720 __tmp.put_i16_le(self.end_index);
21721 __tmp.put_u8(self.target_system);
21722 __tmp.put_u8(self.target_component);
21723 if matches!(version, MavlinkVersion::V2) {
21724 __tmp.put_u8(self.mission_type as u8);
21725 let len = __tmp.len();
21726 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21727 } else {
21728 __tmp.len()
21729 }
21730 }
21731}
21732#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
21733#[doc = "Orientation of a mount."]
21734#[doc = ""]
21735#[doc = "ID: 265"]
21736#[derive(Debug, Clone, PartialEq)]
21737#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21738#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21739#[cfg_attr(feature = "ts", derive(TS))]
21740#[cfg_attr(feature = "ts", ts(export))]
21741pub struct MOUNT_ORIENTATION_DATA {
21742 #[doc = "Timestamp (time since system boot)."]
21743 pub time_boot_ms: u32,
21744 #[doc = "Roll in global frame (set to NaN for invalid)."]
21745 pub roll: f32,
21746 #[doc = "Pitch in global frame (set to NaN for invalid)."]
21747 pub pitch: f32,
21748 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
21749 pub yaw: f32,
21750 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
21751 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21752 pub yaw_absolute: f32,
21753}
21754impl MOUNT_ORIENTATION_DATA {
21755 pub const ENCODED_LEN: usize = 20usize;
21756 pub const DEFAULT: Self = Self {
21757 time_boot_ms: 0_u32,
21758 roll: 0.0_f32,
21759 pitch: 0.0_f32,
21760 yaw: 0.0_f32,
21761 yaw_absolute: 0.0_f32,
21762 };
21763 #[cfg(feature = "arbitrary")]
21764 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21765 use arbitrary::{Arbitrary, Unstructured};
21766 let mut buf = [0u8; 1024];
21767 rng.fill_bytes(&mut buf);
21768 let mut unstructured = Unstructured::new(&buf);
21769 Self::arbitrary(&mut unstructured).unwrap_or_default()
21770 }
21771}
21772impl Default for MOUNT_ORIENTATION_DATA {
21773 fn default() -> Self {
21774 Self::DEFAULT.clone()
21775 }
21776}
21777impl MessageData for MOUNT_ORIENTATION_DATA {
21778 type Message = MavMessage;
21779 const ID: u32 = 265u32;
21780 const NAME: &'static str = "MOUNT_ORIENTATION";
21781 const EXTRA_CRC: u8 = 26u8;
21782 const ENCODED_LEN: usize = 20usize;
21783 fn deser(
21784 _version: MavlinkVersion,
21785 __input: &[u8],
21786 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21787 let avail_len = __input.len();
21788 let mut payload_buf = [0; Self::ENCODED_LEN];
21789 let mut buf = if avail_len < Self::ENCODED_LEN {
21790 payload_buf[0..avail_len].copy_from_slice(__input);
21791 Bytes::new(&payload_buf)
21792 } else {
21793 Bytes::new(__input)
21794 };
21795 let mut __struct = Self::default();
21796 __struct.time_boot_ms = buf.get_u32_le();
21797 __struct.roll = buf.get_f32_le();
21798 __struct.pitch = buf.get_f32_le();
21799 __struct.yaw = buf.get_f32_le();
21800 __struct.yaw_absolute = buf.get_f32_le();
21801 Ok(__struct)
21802 }
21803 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21804 let mut __tmp = BytesMut::new(bytes);
21805 #[allow(clippy::absurd_extreme_comparisons)]
21806 #[allow(unused_comparisons)]
21807 if __tmp.remaining() < Self::ENCODED_LEN {
21808 panic!(
21809 "buffer is too small (need {} bytes, but got {})",
21810 Self::ENCODED_LEN,
21811 __tmp.remaining(),
21812 )
21813 }
21814 __tmp.put_u32_le(self.time_boot_ms);
21815 __tmp.put_f32_le(self.roll);
21816 __tmp.put_f32_le(self.pitch);
21817 __tmp.put_f32_le(self.yaw);
21818 if matches!(version, MavlinkVersion::V2) {
21819 __tmp.put_f32_le(self.yaw_absolute);
21820 let len = __tmp.len();
21821 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21822 } else {
21823 __tmp.len()
21824 }
21825 }
21826}
21827#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21828#[doc = ""]
21829#[doc = "ID: 251"]
21830#[derive(Debug, Clone, PartialEq)]
21831#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21832#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21833#[cfg_attr(feature = "ts", derive(TS))]
21834#[cfg_attr(feature = "ts", ts(export))]
21835pub struct NAMED_VALUE_FLOAT_DATA {
21836 #[doc = "Timestamp (time since system boot)."]
21837 pub time_boot_ms: u32,
21838 #[doc = "Floating point value"]
21839 pub value: f32,
21840 #[doc = "Name of the debug variable"]
21841 #[cfg_attr(feature = "ts", ts(type = "string"))]
21842 pub name: CharArray<10>,
21843}
21844impl NAMED_VALUE_FLOAT_DATA {
21845 pub const ENCODED_LEN: usize = 18usize;
21846 pub const DEFAULT: Self = Self {
21847 time_boot_ms: 0_u32,
21848 value: 0.0_f32,
21849 name: CharArray::new([0_u8; 10usize]),
21850 };
21851 #[cfg(feature = "arbitrary")]
21852 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21853 use arbitrary::{Arbitrary, Unstructured};
21854 let mut buf = [0u8; 1024];
21855 rng.fill_bytes(&mut buf);
21856 let mut unstructured = Unstructured::new(&buf);
21857 Self::arbitrary(&mut unstructured).unwrap_or_default()
21858 }
21859}
21860impl Default for NAMED_VALUE_FLOAT_DATA {
21861 fn default() -> Self {
21862 Self::DEFAULT.clone()
21863 }
21864}
21865impl MessageData for NAMED_VALUE_FLOAT_DATA {
21866 type Message = MavMessage;
21867 const ID: u32 = 251u32;
21868 const NAME: &'static str = "NAMED_VALUE_FLOAT";
21869 const EXTRA_CRC: u8 = 170u8;
21870 const ENCODED_LEN: usize = 18usize;
21871 fn deser(
21872 _version: MavlinkVersion,
21873 __input: &[u8],
21874 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21875 let avail_len = __input.len();
21876 let mut payload_buf = [0; Self::ENCODED_LEN];
21877 let mut buf = if avail_len < Self::ENCODED_LEN {
21878 payload_buf[0..avail_len].copy_from_slice(__input);
21879 Bytes::new(&payload_buf)
21880 } else {
21881 Bytes::new(__input)
21882 };
21883 let mut __struct = Self::default();
21884 __struct.time_boot_ms = buf.get_u32_le();
21885 __struct.value = buf.get_f32_le();
21886 let mut tmp = [0_u8; 10usize];
21887 for v in &mut tmp {
21888 *v = buf.get_u8();
21889 }
21890 __struct.name = CharArray::new(tmp);
21891 Ok(__struct)
21892 }
21893 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21894 let mut __tmp = BytesMut::new(bytes);
21895 #[allow(clippy::absurd_extreme_comparisons)]
21896 #[allow(unused_comparisons)]
21897 if __tmp.remaining() < Self::ENCODED_LEN {
21898 panic!(
21899 "buffer is too small (need {} bytes, but got {})",
21900 Self::ENCODED_LEN,
21901 __tmp.remaining(),
21902 )
21903 }
21904 __tmp.put_u32_le(self.time_boot_ms);
21905 __tmp.put_f32_le(self.value);
21906 for val in &self.name {
21907 __tmp.put_u8(*val);
21908 }
21909 if matches!(version, MavlinkVersion::V2) {
21910 let len = __tmp.len();
21911 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21912 } else {
21913 __tmp.len()
21914 }
21915 }
21916}
21917#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21918#[doc = ""]
21919#[doc = "ID: 252"]
21920#[derive(Debug, Clone, PartialEq)]
21921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21922#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21923#[cfg_attr(feature = "ts", derive(TS))]
21924#[cfg_attr(feature = "ts", ts(export))]
21925pub struct NAMED_VALUE_INT_DATA {
21926 #[doc = "Timestamp (time since system boot)."]
21927 pub time_boot_ms: u32,
21928 #[doc = "Signed integer value"]
21929 pub value: i32,
21930 #[doc = "Name of the debug variable"]
21931 #[cfg_attr(feature = "ts", ts(type = "string"))]
21932 pub name: CharArray<10>,
21933}
21934impl NAMED_VALUE_INT_DATA {
21935 pub const ENCODED_LEN: usize = 18usize;
21936 pub const DEFAULT: Self = Self {
21937 time_boot_ms: 0_u32,
21938 value: 0_i32,
21939 name: CharArray::new([0_u8; 10usize]),
21940 };
21941 #[cfg(feature = "arbitrary")]
21942 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21943 use arbitrary::{Arbitrary, Unstructured};
21944 let mut buf = [0u8; 1024];
21945 rng.fill_bytes(&mut buf);
21946 let mut unstructured = Unstructured::new(&buf);
21947 Self::arbitrary(&mut unstructured).unwrap_or_default()
21948 }
21949}
21950impl Default for NAMED_VALUE_INT_DATA {
21951 fn default() -> Self {
21952 Self::DEFAULT.clone()
21953 }
21954}
21955impl MessageData for NAMED_VALUE_INT_DATA {
21956 type Message = MavMessage;
21957 const ID: u32 = 252u32;
21958 const NAME: &'static str = "NAMED_VALUE_INT";
21959 const EXTRA_CRC: u8 = 44u8;
21960 const ENCODED_LEN: usize = 18usize;
21961 fn deser(
21962 _version: MavlinkVersion,
21963 __input: &[u8],
21964 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21965 let avail_len = __input.len();
21966 let mut payload_buf = [0; Self::ENCODED_LEN];
21967 let mut buf = if avail_len < Self::ENCODED_LEN {
21968 payload_buf[0..avail_len].copy_from_slice(__input);
21969 Bytes::new(&payload_buf)
21970 } else {
21971 Bytes::new(__input)
21972 };
21973 let mut __struct = Self::default();
21974 __struct.time_boot_ms = buf.get_u32_le();
21975 __struct.value = buf.get_i32_le();
21976 let mut tmp = [0_u8; 10usize];
21977 for v in &mut tmp {
21978 *v = buf.get_u8();
21979 }
21980 __struct.name = CharArray::new(tmp);
21981 Ok(__struct)
21982 }
21983 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21984 let mut __tmp = BytesMut::new(bytes);
21985 #[allow(clippy::absurd_extreme_comparisons)]
21986 #[allow(unused_comparisons)]
21987 if __tmp.remaining() < Self::ENCODED_LEN {
21988 panic!(
21989 "buffer is too small (need {} bytes, but got {})",
21990 Self::ENCODED_LEN,
21991 __tmp.remaining(),
21992 )
21993 }
21994 __tmp.put_u32_le(self.time_boot_ms);
21995 __tmp.put_i32_le(self.value);
21996 for val in &self.name {
21997 __tmp.put_u8(*val);
21998 }
21999 if matches!(version, MavlinkVersion::V2) {
22000 let len = __tmp.len();
22001 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22002 } else {
22003 __tmp.len()
22004 }
22005 }
22006}
22007#[doc = "The state of the navigation and position controller."]
22008#[doc = ""]
22009#[doc = "ID: 62"]
22010#[derive(Debug, Clone, PartialEq)]
22011#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22013#[cfg_attr(feature = "ts", derive(TS))]
22014#[cfg_attr(feature = "ts", ts(export))]
22015pub struct NAV_CONTROLLER_OUTPUT_DATA {
22016 #[doc = "Current desired roll"]
22017 pub nav_roll: f32,
22018 #[doc = "Current desired pitch"]
22019 pub nav_pitch: f32,
22020 #[doc = "Current altitude error"]
22021 pub alt_error: f32,
22022 #[doc = "Current airspeed error"]
22023 pub aspd_error: f32,
22024 #[doc = "Current crosstrack error on x-y plane"]
22025 pub xtrack_error: f32,
22026 #[doc = "Current desired heading"]
22027 pub nav_bearing: i16,
22028 #[doc = "Bearing to current waypoint/target"]
22029 pub target_bearing: i16,
22030 #[doc = "Distance to active waypoint"]
22031 pub wp_dist: u16,
22032}
22033impl NAV_CONTROLLER_OUTPUT_DATA {
22034 pub const ENCODED_LEN: usize = 26usize;
22035 pub const DEFAULT: Self = Self {
22036 nav_roll: 0.0_f32,
22037 nav_pitch: 0.0_f32,
22038 alt_error: 0.0_f32,
22039 aspd_error: 0.0_f32,
22040 xtrack_error: 0.0_f32,
22041 nav_bearing: 0_i16,
22042 target_bearing: 0_i16,
22043 wp_dist: 0_u16,
22044 };
22045 #[cfg(feature = "arbitrary")]
22046 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22047 use arbitrary::{Arbitrary, Unstructured};
22048 let mut buf = [0u8; 1024];
22049 rng.fill_bytes(&mut buf);
22050 let mut unstructured = Unstructured::new(&buf);
22051 Self::arbitrary(&mut unstructured).unwrap_or_default()
22052 }
22053}
22054impl Default for NAV_CONTROLLER_OUTPUT_DATA {
22055 fn default() -> Self {
22056 Self::DEFAULT.clone()
22057 }
22058}
22059impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
22060 type Message = MavMessage;
22061 const ID: u32 = 62u32;
22062 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
22063 const EXTRA_CRC: u8 = 183u8;
22064 const ENCODED_LEN: usize = 26usize;
22065 fn deser(
22066 _version: MavlinkVersion,
22067 __input: &[u8],
22068 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22069 let avail_len = __input.len();
22070 let mut payload_buf = [0; Self::ENCODED_LEN];
22071 let mut buf = if avail_len < Self::ENCODED_LEN {
22072 payload_buf[0..avail_len].copy_from_slice(__input);
22073 Bytes::new(&payload_buf)
22074 } else {
22075 Bytes::new(__input)
22076 };
22077 let mut __struct = Self::default();
22078 __struct.nav_roll = buf.get_f32_le();
22079 __struct.nav_pitch = buf.get_f32_le();
22080 __struct.alt_error = buf.get_f32_le();
22081 __struct.aspd_error = buf.get_f32_le();
22082 __struct.xtrack_error = buf.get_f32_le();
22083 __struct.nav_bearing = buf.get_i16_le();
22084 __struct.target_bearing = buf.get_i16_le();
22085 __struct.wp_dist = buf.get_u16_le();
22086 Ok(__struct)
22087 }
22088 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22089 let mut __tmp = BytesMut::new(bytes);
22090 #[allow(clippy::absurd_extreme_comparisons)]
22091 #[allow(unused_comparisons)]
22092 if __tmp.remaining() < Self::ENCODED_LEN {
22093 panic!(
22094 "buffer is too small (need {} bytes, but got {})",
22095 Self::ENCODED_LEN,
22096 __tmp.remaining(),
22097 )
22098 }
22099 __tmp.put_f32_le(self.nav_roll);
22100 __tmp.put_f32_le(self.nav_pitch);
22101 __tmp.put_f32_le(self.alt_error);
22102 __tmp.put_f32_le(self.aspd_error);
22103 __tmp.put_f32_le(self.xtrack_error);
22104 __tmp.put_i16_le(self.nav_bearing);
22105 __tmp.put_i16_le(self.target_bearing);
22106 __tmp.put_u16_le(self.wp_dist);
22107 if matches!(version, MavlinkVersion::V2) {
22108 let len = __tmp.len();
22109 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22110 } else {
22111 __tmp.len()
22112 }
22113 }
22114}
22115#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
22116#[doc = ""]
22117#[doc = "ID: 330"]
22118#[derive(Debug, Clone, PartialEq)]
22119#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22120#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22121#[cfg_attr(feature = "ts", derive(TS))]
22122#[cfg_attr(feature = "ts", ts(export))]
22123pub struct OBSTACLE_DISTANCE_DATA {
22124 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22125 pub time_usec: u64,
22126 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
22127 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22128 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22129 pub distances: [u16; 72],
22130 #[doc = "Minimum distance the sensor can measure."]
22131 pub min_distance: u16,
22132 #[doc = "Maximum distance the sensor can measure."]
22133 pub max_distance: u16,
22134 #[doc = "Class id of the distance sensor type."]
22135 pub sensor_type: MavDistanceSensor,
22136 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
22137 pub increment: u8,
22138 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
22139 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22140 pub increment_f: f32,
22141 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
22142 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22143 pub angle_offset: f32,
22144 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
22145 #[cfg_attr(feature = "serde", serde(default))]
22146 pub frame: MavFrame,
22147}
22148impl OBSTACLE_DISTANCE_DATA {
22149 pub const ENCODED_LEN: usize = 167usize;
22150 pub const DEFAULT: Self = Self {
22151 time_usec: 0_u64,
22152 distances: [0_u16; 72usize],
22153 min_distance: 0_u16,
22154 max_distance: 0_u16,
22155 sensor_type: MavDistanceSensor::DEFAULT,
22156 increment: 0_u8,
22157 increment_f: 0.0_f32,
22158 angle_offset: 0.0_f32,
22159 frame: MavFrame::DEFAULT,
22160 };
22161 #[cfg(feature = "arbitrary")]
22162 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22163 use arbitrary::{Arbitrary, Unstructured};
22164 let mut buf = [0u8; 1024];
22165 rng.fill_bytes(&mut buf);
22166 let mut unstructured = Unstructured::new(&buf);
22167 Self::arbitrary(&mut unstructured).unwrap_or_default()
22168 }
22169}
22170impl Default for OBSTACLE_DISTANCE_DATA {
22171 fn default() -> Self {
22172 Self::DEFAULT.clone()
22173 }
22174}
22175impl MessageData for OBSTACLE_DISTANCE_DATA {
22176 type Message = MavMessage;
22177 const ID: u32 = 330u32;
22178 const NAME: &'static str = "OBSTACLE_DISTANCE";
22179 const EXTRA_CRC: u8 = 23u8;
22180 const ENCODED_LEN: usize = 167usize;
22181 fn deser(
22182 _version: MavlinkVersion,
22183 __input: &[u8],
22184 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22185 let avail_len = __input.len();
22186 let mut payload_buf = [0; Self::ENCODED_LEN];
22187 let mut buf = if avail_len < Self::ENCODED_LEN {
22188 payload_buf[0..avail_len].copy_from_slice(__input);
22189 Bytes::new(&payload_buf)
22190 } else {
22191 Bytes::new(__input)
22192 };
22193 let mut __struct = Self::default();
22194 __struct.time_usec = buf.get_u64_le();
22195 for v in &mut __struct.distances {
22196 let val = buf.get_u16_le();
22197 *v = val;
22198 }
22199 __struct.min_distance = buf.get_u16_le();
22200 __struct.max_distance = buf.get_u16_le();
22201 let tmp = buf.get_u8();
22202 __struct.sensor_type =
22203 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22204 enum_type: "MavDistanceSensor",
22205 value: tmp as u32,
22206 })?;
22207 __struct.increment = buf.get_u8();
22208 __struct.increment_f = buf.get_f32_le();
22209 __struct.angle_offset = buf.get_f32_le();
22210 let tmp = buf.get_u8();
22211 __struct.frame =
22212 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22213 enum_type: "MavFrame",
22214 value: tmp as u32,
22215 })?;
22216 Ok(__struct)
22217 }
22218 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22219 let mut __tmp = BytesMut::new(bytes);
22220 #[allow(clippy::absurd_extreme_comparisons)]
22221 #[allow(unused_comparisons)]
22222 if __tmp.remaining() < Self::ENCODED_LEN {
22223 panic!(
22224 "buffer is too small (need {} bytes, but got {})",
22225 Self::ENCODED_LEN,
22226 __tmp.remaining(),
22227 )
22228 }
22229 __tmp.put_u64_le(self.time_usec);
22230 for val in &self.distances {
22231 __tmp.put_u16_le(*val);
22232 }
22233 __tmp.put_u16_le(self.min_distance);
22234 __tmp.put_u16_le(self.max_distance);
22235 __tmp.put_u8(self.sensor_type as u8);
22236 __tmp.put_u8(self.increment);
22237 if matches!(version, MavlinkVersion::V2) {
22238 __tmp.put_f32_le(self.increment_f);
22239 __tmp.put_f32_le(self.angle_offset);
22240 __tmp.put_u8(self.frame as u8);
22241 let len = __tmp.len();
22242 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22243 } else {
22244 __tmp.len()
22245 }
22246 }
22247}
22248#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
22249#[doc = ""]
22250#[doc = "ID: 331"]
22251#[derive(Debug, Clone, PartialEq)]
22252#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22253#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22254#[cfg_attr(feature = "ts", derive(TS))]
22255#[cfg_attr(feature = "ts", ts(export))]
22256pub struct ODOMETRY_DATA {
22257 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22258 pub time_usec: u64,
22259 #[doc = "X Position"]
22260 pub x: f32,
22261 #[doc = "Y Position"]
22262 pub y: f32,
22263 #[doc = "Z Position"]
22264 pub z: f32,
22265 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
22266 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22267 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22268 pub q: [f32; 4],
22269 #[doc = "X linear speed"]
22270 pub vx: f32,
22271 #[doc = "Y linear speed"]
22272 pub vy: f32,
22273 #[doc = "Z linear speed"]
22274 pub vz: f32,
22275 #[doc = "Roll angular speed"]
22276 pub rollspeed: f32,
22277 #[doc = "Pitch angular speed"]
22278 pub pitchspeed: f32,
22279 #[doc = "Yaw angular speed"]
22280 pub yawspeed: f32,
22281 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
22282 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22283 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22284 pub pose_covariance: [f32; 21],
22285 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
22286 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22287 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22288 pub velocity_covariance: [f32; 21],
22289 #[doc = "Coordinate frame of reference for the pose data."]
22290 pub frame_id: MavFrame,
22291 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
22292 pub child_frame_id: MavFrame,
22293 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
22294 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22295 pub reset_counter: u8,
22296 #[doc = "Type of estimator that is providing the odometry."]
22297 #[cfg_attr(feature = "serde", serde(default))]
22298 pub estimator_type: MavEstimatorType,
22299 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
22300 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22301 pub quality: i8,
22302}
22303impl ODOMETRY_DATA {
22304 pub const ENCODED_LEN: usize = 233usize;
22305 pub const DEFAULT: Self = Self {
22306 time_usec: 0_u64,
22307 x: 0.0_f32,
22308 y: 0.0_f32,
22309 z: 0.0_f32,
22310 q: [0.0_f32; 4usize],
22311 vx: 0.0_f32,
22312 vy: 0.0_f32,
22313 vz: 0.0_f32,
22314 rollspeed: 0.0_f32,
22315 pitchspeed: 0.0_f32,
22316 yawspeed: 0.0_f32,
22317 pose_covariance: [0.0_f32; 21usize],
22318 velocity_covariance: [0.0_f32; 21usize],
22319 frame_id: MavFrame::DEFAULT,
22320 child_frame_id: MavFrame::DEFAULT,
22321 reset_counter: 0_u8,
22322 estimator_type: MavEstimatorType::DEFAULT,
22323 quality: 0_i8,
22324 };
22325 #[cfg(feature = "arbitrary")]
22326 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22327 use arbitrary::{Arbitrary, Unstructured};
22328 let mut buf = [0u8; 1024];
22329 rng.fill_bytes(&mut buf);
22330 let mut unstructured = Unstructured::new(&buf);
22331 Self::arbitrary(&mut unstructured).unwrap_or_default()
22332 }
22333}
22334impl Default for ODOMETRY_DATA {
22335 fn default() -> Self {
22336 Self::DEFAULT.clone()
22337 }
22338}
22339impl MessageData for ODOMETRY_DATA {
22340 type Message = MavMessage;
22341 const ID: u32 = 331u32;
22342 const NAME: &'static str = "ODOMETRY";
22343 const EXTRA_CRC: u8 = 91u8;
22344 const ENCODED_LEN: usize = 233usize;
22345 fn deser(
22346 _version: MavlinkVersion,
22347 __input: &[u8],
22348 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22349 let avail_len = __input.len();
22350 let mut payload_buf = [0; Self::ENCODED_LEN];
22351 let mut buf = if avail_len < Self::ENCODED_LEN {
22352 payload_buf[0..avail_len].copy_from_slice(__input);
22353 Bytes::new(&payload_buf)
22354 } else {
22355 Bytes::new(__input)
22356 };
22357 let mut __struct = Self::default();
22358 __struct.time_usec = buf.get_u64_le();
22359 __struct.x = buf.get_f32_le();
22360 __struct.y = buf.get_f32_le();
22361 __struct.z = buf.get_f32_le();
22362 for v in &mut __struct.q {
22363 let val = buf.get_f32_le();
22364 *v = val;
22365 }
22366 __struct.vx = buf.get_f32_le();
22367 __struct.vy = buf.get_f32_le();
22368 __struct.vz = buf.get_f32_le();
22369 __struct.rollspeed = buf.get_f32_le();
22370 __struct.pitchspeed = buf.get_f32_le();
22371 __struct.yawspeed = buf.get_f32_le();
22372 for v in &mut __struct.pose_covariance {
22373 let val = buf.get_f32_le();
22374 *v = val;
22375 }
22376 for v in &mut __struct.velocity_covariance {
22377 let val = buf.get_f32_le();
22378 *v = val;
22379 }
22380 let tmp = buf.get_u8();
22381 __struct.frame_id =
22382 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22383 enum_type: "MavFrame",
22384 value: tmp as u32,
22385 })?;
22386 let tmp = buf.get_u8();
22387 __struct.child_frame_id =
22388 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22389 enum_type: "MavFrame",
22390 value: tmp as u32,
22391 })?;
22392 __struct.reset_counter = buf.get_u8();
22393 let tmp = buf.get_u8();
22394 __struct.estimator_type =
22395 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22396 enum_type: "MavEstimatorType",
22397 value: tmp as u32,
22398 })?;
22399 __struct.quality = buf.get_i8();
22400 Ok(__struct)
22401 }
22402 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22403 let mut __tmp = BytesMut::new(bytes);
22404 #[allow(clippy::absurd_extreme_comparisons)]
22405 #[allow(unused_comparisons)]
22406 if __tmp.remaining() < Self::ENCODED_LEN {
22407 panic!(
22408 "buffer is too small (need {} bytes, but got {})",
22409 Self::ENCODED_LEN,
22410 __tmp.remaining(),
22411 )
22412 }
22413 __tmp.put_u64_le(self.time_usec);
22414 __tmp.put_f32_le(self.x);
22415 __tmp.put_f32_le(self.y);
22416 __tmp.put_f32_le(self.z);
22417 for val in &self.q {
22418 __tmp.put_f32_le(*val);
22419 }
22420 __tmp.put_f32_le(self.vx);
22421 __tmp.put_f32_le(self.vy);
22422 __tmp.put_f32_le(self.vz);
22423 __tmp.put_f32_le(self.rollspeed);
22424 __tmp.put_f32_le(self.pitchspeed);
22425 __tmp.put_f32_le(self.yawspeed);
22426 for val in &self.pose_covariance {
22427 __tmp.put_f32_le(*val);
22428 }
22429 for val in &self.velocity_covariance {
22430 __tmp.put_f32_le(*val);
22431 }
22432 __tmp.put_u8(self.frame_id as u8);
22433 __tmp.put_u8(self.child_frame_id as u8);
22434 if matches!(version, MavlinkVersion::V2) {
22435 __tmp.put_u8(self.reset_counter);
22436 __tmp.put_u8(self.estimator_type as u8);
22437 __tmp.put_i8(self.quality);
22438 let len = __tmp.len();
22439 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22440 } else {
22441 __tmp.len()
22442 }
22443 }
22444}
22445#[doc = "Hardware status sent by an onboard computer."]
22446#[doc = ""]
22447#[doc = "ID: 390"]
22448#[derive(Debug, Clone, PartialEq)]
22449#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22450#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22451#[cfg_attr(feature = "ts", derive(TS))]
22452#[cfg_attr(feature = "ts", ts(export))]
22453pub struct ONBOARD_COMPUTER_STATUS_DATA {
22454 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22455 pub time_usec: u64,
22456 #[doc = "Time since system boot."]
22457 pub uptime: u32,
22458 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
22459 pub ram_usage: u32,
22460 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
22461 pub ram_total: u32,
22462 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
22463 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22464 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22465 pub storage_type: [u32; 4],
22466 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
22467 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22468 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22469 pub storage_usage: [u32; 4],
22470 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
22471 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22472 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22473 pub storage_total: [u32; 4],
22474 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
22475 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22476 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22477 pub link_type: [u32; 6],
22478 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
22479 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22480 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22481 pub link_tx_rate: [u32; 6],
22482 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
22483 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22484 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22485 pub link_rx_rate: [u32; 6],
22486 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
22487 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22488 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22489 pub link_tx_max: [u32; 6],
22490 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
22491 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22492 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22493 pub link_rx_max: [u32; 6],
22494 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
22495 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22496 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22497 pub fan_speed: [i16; 4],
22498 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
22499 pub mavtype: u8,
22500 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
22501 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22502 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22503 pub cpu_cores: [u8; 8],
22504 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
22505 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22506 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22507 pub cpu_combined: [u8; 10],
22508 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
22509 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22510 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22511 pub gpu_cores: [u8; 4],
22512 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
22513 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22514 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22515 pub gpu_combined: [u8; 10],
22516 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
22517 pub temperature_board: i8,
22518 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
22519 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22520 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22521 pub temperature_core: [i8; 8],
22522}
22523impl ONBOARD_COMPUTER_STATUS_DATA {
22524 pub const ENCODED_LEN: usize = 238usize;
22525 pub const DEFAULT: Self = Self {
22526 time_usec: 0_u64,
22527 uptime: 0_u32,
22528 ram_usage: 0_u32,
22529 ram_total: 0_u32,
22530 storage_type: [0_u32; 4usize],
22531 storage_usage: [0_u32; 4usize],
22532 storage_total: [0_u32; 4usize],
22533 link_type: [0_u32; 6usize],
22534 link_tx_rate: [0_u32; 6usize],
22535 link_rx_rate: [0_u32; 6usize],
22536 link_tx_max: [0_u32; 6usize],
22537 link_rx_max: [0_u32; 6usize],
22538 fan_speed: [0_i16; 4usize],
22539 mavtype: 0_u8,
22540 cpu_cores: [0_u8; 8usize],
22541 cpu_combined: [0_u8; 10usize],
22542 gpu_cores: [0_u8; 4usize],
22543 gpu_combined: [0_u8; 10usize],
22544 temperature_board: 0_i8,
22545 temperature_core: [0_i8; 8usize],
22546 };
22547 #[cfg(feature = "arbitrary")]
22548 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22549 use arbitrary::{Arbitrary, Unstructured};
22550 let mut buf = [0u8; 1024];
22551 rng.fill_bytes(&mut buf);
22552 let mut unstructured = Unstructured::new(&buf);
22553 Self::arbitrary(&mut unstructured).unwrap_or_default()
22554 }
22555}
22556impl Default for ONBOARD_COMPUTER_STATUS_DATA {
22557 fn default() -> Self {
22558 Self::DEFAULT.clone()
22559 }
22560}
22561impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
22562 type Message = MavMessage;
22563 const ID: u32 = 390u32;
22564 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
22565 const EXTRA_CRC: u8 = 156u8;
22566 const ENCODED_LEN: usize = 238usize;
22567 fn deser(
22568 _version: MavlinkVersion,
22569 __input: &[u8],
22570 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22571 let avail_len = __input.len();
22572 let mut payload_buf = [0; Self::ENCODED_LEN];
22573 let mut buf = if avail_len < Self::ENCODED_LEN {
22574 payload_buf[0..avail_len].copy_from_slice(__input);
22575 Bytes::new(&payload_buf)
22576 } else {
22577 Bytes::new(__input)
22578 };
22579 let mut __struct = Self::default();
22580 __struct.time_usec = buf.get_u64_le();
22581 __struct.uptime = buf.get_u32_le();
22582 __struct.ram_usage = buf.get_u32_le();
22583 __struct.ram_total = buf.get_u32_le();
22584 for v in &mut __struct.storage_type {
22585 let val = buf.get_u32_le();
22586 *v = val;
22587 }
22588 for v in &mut __struct.storage_usage {
22589 let val = buf.get_u32_le();
22590 *v = val;
22591 }
22592 for v in &mut __struct.storage_total {
22593 let val = buf.get_u32_le();
22594 *v = val;
22595 }
22596 for v in &mut __struct.link_type {
22597 let val = buf.get_u32_le();
22598 *v = val;
22599 }
22600 for v in &mut __struct.link_tx_rate {
22601 let val = buf.get_u32_le();
22602 *v = val;
22603 }
22604 for v in &mut __struct.link_rx_rate {
22605 let val = buf.get_u32_le();
22606 *v = val;
22607 }
22608 for v in &mut __struct.link_tx_max {
22609 let val = buf.get_u32_le();
22610 *v = val;
22611 }
22612 for v in &mut __struct.link_rx_max {
22613 let val = buf.get_u32_le();
22614 *v = val;
22615 }
22616 for v in &mut __struct.fan_speed {
22617 let val = buf.get_i16_le();
22618 *v = val;
22619 }
22620 __struct.mavtype = buf.get_u8();
22621 for v in &mut __struct.cpu_cores {
22622 let val = buf.get_u8();
22623 *v = val;
22624 }
22625 for v in &mut __struct.cpu_combined {
22626 let val = buf.get_u8();
22627 *v = val;
22628 }
22629 for v in &mut __struct.gpu_cores {
22630 let val = buf.get_u8();
22631 *v = val;
22632 }
22633 for v in &mut __struct.gpu_combined {
22634 let val = buf.get_u8();
22635 *v = val;
22636 }
22637 __struct.temperature_board = buf.get_i8();
22638 for v in &mut __struct.temperature_core {
22639 let val = buf.get_i8();
22640 *v = val;
22641 }
22642 Ok(__struct)
22643 }
22644 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22645 let mut __tmp = BytesMut::new(bytes);
22646 #[allow(clippy::absurd_extreme_comparisons)]
22647 #[allow(unused_comparisons)]
22648 if __tmp.remaining() < Self::ENCODED_LEN {
22649 panic!(
22650 "buffer is too small (need {} bytes, but got {})",
22651 Self::ENCODED_LEN,
22652 __tmp.remaining(),
22653 )
22654 }
22655 __tmp.put_u64_le(self.time_usec);
22656 __tmp.put_u32_le(self.uptime);
22657 __tmp.put_u32_le(self.ram_usage);
22658 __tmp.put_u32_le(self.ram_total);
22659 for val in &self.storage_type {
22660 __tmp.put_u32_le(*val);
22661 }
22662 for val in &self.storage_usage {
22663 __tmp.put_u32_le(*val);
22664 }
22665 for val in &self.storage_total {
22666 __tmp.put_u32_le(*val);
22667 }
22668 for val in &self.link_type {
22669 __tmp.put_u32_le(*val);
22670 }
22671 for val in &self.link_tx_rate {
22672 __tmp.put_u32_le(*val);
22673 }
22674 for val in &self.link_rx_rate {
22675 __tmp.put_u32_le(*val);
22676 }
22677 for val in &self.link_tx_max {
22678 __tmp.put_u32_le(*val);
22679 }
22680 for val in &self.link_rx_max {
22681 __tmp.put_u32_le(*val);
22682 }
22683 for val in &self.fan_speed {
22684 __tmp.put_i16_le(*val);
22685 }
22686 __tmp.put_u8(self.mavtype);
22687 for val in &self.cpu_cores {
22688 __tmp.put_u8(*val);
22689 }
22690 for val in &self.cpu_combined {
22691 __tmp.put_u8(*val);
22692 }
22693 for val in &self.gpu_cores {
22694 __tmp.put_u8(*val);
22695 }
22696 for val in &self.gpu_combined {
22697 __tmp.put_u8(*val);
22698 }
22699 __tmp.put_i8(self.temperature_board);
22700 for val in &self.temperature_core {
22701 __tmp.put_i8(*val);
22702 }
22703 if matches!(version, MavlinkVersion::V2) {
22704 let len = __tmp.len();
22705 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22706 } else {
22707 __tmp.len()
22708 }
22709 }
22710}
22711#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
22712#[doc = ""]
22713#[doc = "ID: 12918"]
22714#[derive(Debug, Clone, PartialEq)]
22715#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22717#[cfg_attr(feature = "ts", derive(TS))]
22718#[cfg_attr(feature = "ts", ts(export))]
22719pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
22720 #[doc = "Status level indicating if arming is allowed."]
22721 pub status: MavOdidArmStatus,
22722 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
22723 #[cfg_attr(feature = "ts", ts(type = "string"))]
22724 pub error: CharArray<50>,
22725}
22726impl OPEN_DRONE_ID_ARM_STATUS_DATA {
22727 pub const ENCODED_LEN: usize = 51usize;
22728 pub const DEFAULT: Self = Self {
22729 status: MavOdidArmStatus::DEFAULT,
22730 error: CharArray::new([0_u8; 50usize]),
22731 };
22732 #[cfg(feature = "arbitrary")]
22733 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22734 use arbitrary::{Arbitrary, Unstructured};
22735 let mut buf = [0u8; 1024];
22736 rng.fill_bytes(&mut buf);
22737 let mut unstructured = Unstructured::new(&buf);
22738 Self::arbitrary(&mut unstructured).unwrap_or_default()
22739 }
22740}
22741impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
22742 fn default() -> Self {
22743 Self::DEFAULT.clone()
22744 }
22745}
22746impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
22747 type Message = MavMessage;
22748 const ID: u32 = 12918u32;
22749 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
22750 const EXTRA_CRC: u8 = 139u8;
22751 const ENCODED_LEN: usize = 51usize;
22752 fn deser(
22753 _version: MavlinkVersion,
22754 __input: &[u8],
22755 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22756 let avail_len = __input.len();
22757 let mut payload_buf = [0; Self::ENCODED_LEN];
22758 let mut buf = if avail_len < Self::ENCODED_LEN {
22759 payload_buf[0..avail_len].copy_from_slice(__input);
22760 Bytes::new(&payload_buf)
22761 } else {
22762 Bytes::new(__input)
22763 };
22764 let mut __struct = Self::default();
22765 let tmp = buf.get_u8();
22766 __struct.status =
22767 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22768 enum_type: "MavOdidArmStatus",
22769 value: tmp as u32,
22770 })?;
22771 let mut tmp = [0_u8; 50usize];
22772 for v in &mut tmp {
22773 *v = buf.get_u8();
22774 }
22775 __struct.error = CharArray::new(tmp);
22776 Ok(__struct)
22777 }
22778 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22779 let mut __tmp = BytesMut::new(bytes);
22780 #[allow(clippy::absurd_extreme_comparisons)]
22781 #[allow(unused_comparisons)]
22782 if __tmp.remaining() < Self::ENCODED_LEN {
22783 panic!(
22784 "buffer is too small (need {} bytes, but got {})",
22785 Self::ENCODED_LEN,
22786 __tmp.remaining(),
22787 )
22788 }
22789 __tmp.put_u8(self.status as u8);
22790 for val in &self.error {
22791 __tmp.put_u8(*val);
22792 }
22793 if matches!(version, MavlinkVersion::V2) {
22794 let len = __tmp.len();
22795 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22796 } else {
22797 __tmp.len()
22798 }
22799 }
22800}
22801#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
22802#[doc = ""]
22803#[doc = "ID: 12902"]
22804#[derive(Debug, Clone, PartialEq)]
22805#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22806#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22807#[cfg_attr(feature = "ts", derive(TS))]
22808#[cfg_attr(feature = "ts", ts(export))]
22809pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
22810 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22811 pub timestamp: u32,
22812 #[doc = "System ID (0 for broadcast)."]
22813 pub target_system: u8,
22814 #[doc = "Component ID (0 for broadcast)."]
22815 pub target_component: u8,
22816 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22817 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22818 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22819 pub id_or_mac: [u8; 20],
22820 #[doc = "Indicates the type of authentication."]
22821 pub authentication_type: MavOdidAuthType,
22822 #[doc = "Allowed range is 0 - 15."]
22823 pub data_page: u8,
22824 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22825 pub last_page_index: u8,
22826 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22827 pub length: u8,
22828 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
22829 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22830 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22831 pub authentication_data: [u8; 23],
22832}
22833impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
22834 pub const ENCODED_LEN: usize = 53usize;
22835 pub const DEFAULT: Self = Self {
22836 timestamp: 0_u32,
22837 target_system: 0_u8,
22838 target_component: 0_u8,
22839 id_or_mac: [0_u8; 20usize],
22840 authentication_type: MavOdidAuthType::DEFAULT,
22841 data_page: 0_u8,
22842 last_page_index: 0_u8,
22843 length: 0_u8,
22844 authentication_data: [0_u8; 23usize],
22845 };
22846 #[cfg(feature = "arbitrary")]
22847 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22848 use arbitrary::{Arbitrary, Unstructured};
22849 let mut buf = [0u8; 1024];
22850 rng.fill_bytes(&mut buf);
22851 let mut unstructured = Unstructured::new(&buf);
22852 Self::arbitrary(&mut unstructured).unwrap_or_default()
22853 }
22854}
22855impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22856 fn default() -> Self {
22857 Self::DEFAULT.clone()
22858 }
22859}
22860impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22861 type Message = MavMessage;
22862 const ID: u32 = 12902u32;
22863 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
22864 const EXTRA_CRC: u8 = 140u8;
22865 const ENCODED_LEN: usize = 53usize;
22866 fn deser(
22867 _version: MavlinkVersion,
22868 __input: &[u8],
22869 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22870 let avail_len = __input.len();
22871 let mut payload_buf = [0; Self::ENCODED_LEN];
22872 let mut buf = if avail_len < Self::ENCODED_LEN {
22873 payload_buf[0..avail_len].copy_from_slice(__input);
22874 Bytes::new(&payload_buf)
22875 } else {
22876 Bytes::new(__input)
22877 };
22878 let mut __struct = Self::default();
22879 __struct.timestamp = buf.get_u32_le();
22880 __struct.target_system = buf.get_u8();
22881 __struct.target_component = buf.get_u8();
22882 for v in &mut __struct.id_or_mac {
22883 let val = buf.get_u8();
22884 *v = val;
22885 }
22886 let tmp = buf.get_u8();
22887 __struct.authentication_type =
22888 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22889 enum_type: "MavOdidAuthType",
22890 value: tmp as u32,
22891 })?;
22892 __struct.data_page = buf.get_u8();
22893 __struct.last_page_index = buf.get_u8();
22894 __struct.length = buf.get_u8();
22895 for v in &mut __struct.authentication_data {
22896 let val = buf.get_u8();
22897 *v = val;
22898 }
22899 Ok(__struct)
22900 }
22901 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22902 let mut __tmp = BytesMut::new(bytes);
22903 #[allow(clippy::absurd_extreme_comparisons)]
22904 #[allow(unused_comparisons)]
22905 if __tmp.remaining() < Self::ENCODED_LEN {
22906 panic!(
22907 "buffer is too small (need {} bytes, but got {})",
22908 Self::ENCODED_LEN,
22909 __tmp.remaining(),
22910 )
22911 }
22912 __tmp.put_u32_le(self.timestamp);
22913 __tmp.put_u8(self.target_system);
22914 __tmp.put_u8(self.target_component);
22915 for val in &self.id_or_mac {
22916 __tmp.put_u8(*val);
22917 }
22918 __tmp.put_u8(self.authentication_type as u8);
22919 __tmp.put_u8(self.data_page);
22920 __tmp.put_u8(self.last_page_index);
22921 __tmp.put_u8(self.length);
22922 for val in &self.authentication_data {
22923 __tmp.put_u8(*val);
22924 }
22925 if matches!(version, MavlinkVersion::V2) {
22926 let len = __tmp.len();
22927 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22928 } else {
22929 __tmp.len()
22930 }
22931 }
22932}
22933#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
22934#[doc = ""]
22935#[doc = "ID: 12900"]
22936#[derive(Debug, Clone, PartialEq)]
22937#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22938#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22939#[cfg_attr(feature = "ts", derive(TS))]
22940#[cfg_attr(feature = "ts", ts(export))]
22941pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
22942 #[doc = "System ID (0 for broadcast)."]
22943 pub target_system: u8,
22944 #[doc = "Component ID (0 for broadcast)."]
22945 pub target_component: u8,
22946 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22947 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22948 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22949 pub id_or_mac: [u8; 20],
22950 #[doc = "Indicates the format for the uas_id field of this message."]
22951 pub id_type: MavOdidIdType,
22952 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
22953 pub ua_type: MavOdidUaType,
22954 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
22955 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22956 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22957 pub uas_id: [u8; 20],
22958}
22959impl OPEN_DRONE_ID_BASIC_ID_DATA {
22960 pub const ENCODED_LEN: usize = 44usize;
22961 pub const DEFAULT: Self = Self {
22962 target_system: 0_u8,
22963 target_component: 0_u8,
22964 id_or_mac: [0_u8; 20usize],
22965 id_type: MavOdidIdType::DEFAULT,
22966 ua_type: MavOdidUaType::DEFAULT,
22967 uas_id: [0_u8; 20usize],
22968 };
22969 #[cfg(feature = "arbitrary")]
22970 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22971 use arbitrary::{Arbitrary, Unstructured};
22972 let mut buf = [0u8; 1024];
22973 rng.fill_bytes(&mut buf);
22974 let mut unstructured = Unstructured::new(&buf);
22975 Self::arbitrary(&mut unstructured).unwrap_or_default()
22976 }
22977}
22978impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
22979 fn default() -> Self {
22980 Self::DEFAULT.clone()
22981 }
22982}
22983impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
22984 type Message = MavMessage;
22985 const ID: u32 = 12900u32;
22986 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
22987 const EXTRA_CRC: u8 = 114u8;
22988 const ENCODED_LEN: usize = 44usize;
22989 fn deser(
22990 _version: MavlinkVersion,
22991 __input: &[u8],
22992 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22993 let avail_len = __input.len();
22994 let mut payload_buf = [0; Self::ENCODED_LEN];
22995 let mut buf = if avail_len < Self::ENCODED_LEN {
22996 payload_buf[0..avail_len].copy_from_slice(__input);
22997 Bytes::new(&payload_buf)
22998 } else {
22999 Bytes::new(__input)
23000 };
23001 let mut __struct = Self::default();
23002 __struct.target_system = buf.get_u8();
23003 __struct.target_component = buf.get_u8();
23004 for v in &mut __struct.id_or_mac {
23005 let val = buf.get_u8();
23006 *v = val;
23007 }
23008 let tmp = buf.get_u8();
23009 __struct.id_type =
23010 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23011 enum_type: "MavOdidIdType",
23012 value: tmp as u32,
23013 })?;
23014 let tmp = buf.get_u8();
23015 __struct.ua_type =
23016 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23017 enum_type: "MavOdidUaType",
23018 value: tmp as u32,
23019 })?;
23020 for v in &mut __struct.uas_id {
23021 let val = buf.get_u8();
23022 *v = val;
23023 }
23024 Ok(__struct)
23025 }
23026 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23027 let mut __tmp = BytesMut::new(bytes);
23028 #[allow(clippy::absurd_extreme_comparisons)]
23029 #[allow(unused_comparisons)]
23030 if __tmp.remaining() < Self::ENCODED_LEN {
23031 panic!(
23032 "buffer is too small (need {} bytes, but got {})",
23033 Self::ENCODED_LEN,
23034 __tmp.remaining(),
23035 )
23036 }
23037 __tmp.put_u8(self.target_system);
23038 __tmp.put_u8(self.target_component);
23039 for val in &self.id_or_mac {
23040 __tmp.put_u8(*val);
23041 }
23042 __tmp.put_u8(self.id_type as u8);
23043 __tmp.put_u8(self.ua_type as u8);
23044 for val in &self.uas_id {
23045 __tmp.put_u8(*val);
23046 }
23047 if matches!(version, MavlinkVersion::V2) {
23048 let len = __tmp.len();
23049 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23050 } else {
23051 __tmp.len()
23052 }
23053 }
23054}
23055#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
23056#[doc = ""]
23057#[doc = "ID: 12901"]
23058#[derive(Debug, Clone, PartialEq)]
23059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23060#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23061#[cfg_attr(feature = "ts", derive(TS))]
23062#[cfg_attr(feature = "ts", ts(export))]
23063pub struct OPEN_DRONE_ID_LOCATION_DATA {
23064 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
23065 pub latitude: i32,
23066 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
23067 pub longitude: i32,
23068 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
23069 pub altitude_barometric: f32,
23070 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
23071 pub altitude_geodetic: f32,
23072 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
23073 pub height: f32,
23074 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
23075 pub timestamp: f32,
23076 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
23077 pub direction: u16,
23078 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
23079 pub speed_horizontal: u16,
23080 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
23081 pub speed_vertical: i16,
23082 #[doc = "System ID (0 for broadcast)."]
23083 pub target_system: u8,
23084 #[doc = "Component ID (0 for broadcast)."]
23085 pub target_component: u8,
23086 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23087 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23088 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23089 pub id_or_mac: [u8; 20],
23090 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
23091 pub status: MavOdidStatus,
23092 #[doc = "Indicates the reference point for the height field."]
23093 pub height_reference: MavOdidHeightRef,
23094 #[doc = "The accuracy of the horizontal position."]
23095 pub horizontal_accuracy: MavOdidHorAcc,
23096 #[doc = "The accuracy of the vertical position."]
23097 pub vertical_accuracy: MavOdidVerAcc,
23098 #[doc = "The accuracy of the barometric altitude."]
23099 pub barometer_accuracy: MavOdidVerAcc,
23100 #[doc = "The accuracy of the horizontal and vertical speed."]
23101 pub speed_accuracy: MavOdidSpeedAcc,
23102 #[doc = "The accuracy of the timestamps."]
23103 pub timestamp_accuracy: MavOdidTimeAcc,
23104}
23105impl OPEN_DRONE_ID_LOCATION_DATA {
23106 pub const ENCODED_LEN: usize = 59usize;
23107 pub const DEFAULT: Self = Self {
23108 latitude: 0_i32,
23109 longitude: 0_i32,
23110 altitude_barometric: 0.0_f32,
23111 altitude_geodetic: 0.0_f32,
23112 height: 0.0_f32,
23113 timestamp: 0.0_f32,
23114 direction: 0_u16,
23115 speed_horizontal: 0_u16,
23116 speed_vertical: 0_i16,
23117 target_system: 0_u8,
23118 target_component: 0_u8,
23119 id_or_mac: [0_u8; 20usize],
23120 status: MavOdidStatus::DEFAULT,
23121 height_reference: MavOdidHeightRef::DEFAULT,
23122 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
23123 vertical_accuracy: MavOdidVerAcc::DEFAULT,
23124 barometer_accuracy: MavOdidVerAcc::DEFAULT,
23125 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
23126 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
23127 };
23128 #[cfg(feature = "arbitrary")]
23129 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23130 use arbitrary::{Arbitrary, Unstructured};
23131 let mut buf = [0u8; 1024];
23132 rng.fill_bytes(&mut buf);
23133 let mut unstructured = Unstructured::new(&buf);
23134 Self::arbitrary(&mut unstructured).unwrap_or_default()
23135 }
23136}
23137impl Default for OPEN_DRONE_ID_LOCATION_DATA {
23138 fn default() -> Self {
23139 Self::DEFAULT.clone()
23140 }
23141}
23142impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
23143 type Message = MavMessage;
23144 const ID: u32 = 12901u32;
23145 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
23146 const EXTRA_CRC: u8 = 254u8;
23147 const ENCODED_LEN: usize = 59usize;
23148 fn deser(
23149 _version: MavlinkVersion,
23150 __input: &[u8],
23151 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23152 let avail_len = __input.len();
23153 let mut payload_buf = [0; Self::ENCODED_LEN];
23154 let mut buf = if avail_len < Self::ENCODED_LEN {
23155 payload_buf[0..avail_len].copy_from_slice(__input);
23156 Bytes::new(&payload_buf)
23157 } else {
23158 Bytes::new(__input)
23159 };
23160 let mut __struct = Self::default();
23161 __struct.latitude = buf.get_i32_le();
23162 __struct.longitude = buf.get_i32_le();
23163 __struct.altitude_barometric = buf.get_f32_le();
23164 __struct.altitude_geodetic = buf.get_f32_le();
23165 __struct.height = buf.get_f32_le();
23166 __struct.timestamp = buf.get_f32_le();
23167 __struct.direction = buf.get_u16_le();
23168 __struct.speed_horizontal = buf.get_u16_le();
23169 __struct.speed_vertical = buf.get_i16_le();
23170 __struct.target_system = buf.get_u8();
23171 __struct.target_component = buf.get_u8();
23172 for v in &mut __struct.id_or_mac {
23173 let val = buf.get_u8();
23174 *v = val;
23175 }
23176 let tmp = buf.get_u8();
23177 __struct.status =
23178 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23179 enum_type: "MavOdidStatus",
23180 value: tmp as u32,
23181 })?;
23182 let tmp = buf.get_u8();
23183 __struct.height_reference =
23184 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23185 enum_type: "MavOdidHeightRef",
23186 value: tmp as u32,
23187 })?;
23188 let tmp = buf.get_u8();
23189 __struct.horizontal_accuracy =
23190 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23191 enum_type: "MavOdidHorAcc",
23192 value: tmp as u32,
23193 })?;
23194 let tmp = buf.get_u8();
23195 __struct.vertical_accuracy =
23196 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23197 enum_type: "MavOdidVerAcc",
23198 value: tmp as u32,
23199 })?;
23200 let tmp = buf.get_u8();
23201 __struct.barometer_accuracy =
23202 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23203 enum_type: "MavOdidVerAcc",
23204 value: tmp as u32,
23205 })?;
23206 let tmp = buf.get_u8();
23207 __struct.speed_accuracy =
23208 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23209 enum_type: "MavOdidSpeedAcc",
23210 value: tmp as u32,
23211 })?;
23212 let tmp = buf.get_u8();
23213 __struct.timestamp_accuracy =
23214 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23215 enum_type: "MavOdidTimeAcc",
23216 value: tmp as u32,
23217 })?;
23218 Ok(__struct)
23219 }
23220 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23221 let mut __tmp = BytesMut::new(bytes);
23222 #[allow(clippy::absurd_extreme_comparisons)]
23223 #[allow(unused_comparisons)]
23224 if __tmp.remaining() < Self::ENCODED_LEN {
23225 panic!(
23226 "buffer is too small (need {} bytes, but got {})",
23227 Self::ENCODED_LEN,
23228 __tmp.remaining(),
23229 )
23230 }
23231 __tmp.put_i32_le(self.latitude);
23232 __tmp.put_i32_le(self.longitude);
23233 __tmp.put_f32_le(self.altitude_barometric);
23234 __tmp.put_f32_le(self.altitude_geodetic);
23235 __tmp.put_f32_le(self.height);
23236 __tmp.put_f32_le(self.timestamp);
23237 __tmp.put_u16_le(self.direction);
23238 __tmp.put_u16_le(self.speed_horizontal);
23239 __tmp.put_i16_le(self.speed_vertical);
23240 __tmp.put_u8(self.target_system);
23241 __tmp.put_u8(self.target_component);
23242 for val in &self.id_or_mac {
23243 __tmp.put_u8(*val);
23244 }
23245 __tmp.put_u8(self.status as u8);
23246 __tmp.put_u8(self.height_reference as u8);
23247 __tmp.put_u8(self.horizontal_accuracy as u8);
23248 __tmp.put_u8(self.vertical_accuracy as u8);
23249 __tmp.put_u8(self.barometer_accuracy as u8);
23250 __tmp.put_u8(self.speed_accuracy as u8);
23251 __tmp.put_u8(self.timestamp_accuracy as u8);
23252 if matches!(version, MavlinkVersion::V2) {
23253 let len = __tmp.len();
23254 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23255 } else {
23256 __tmp.len()
23257 }
23258 }
23259}
23260#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
23261#[doc = ""]
23262#[doc = "ID: 12915"]
23263#[derive(Debug, Clone, PartialEq)]
23264#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23265#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23266#[cfg_attr(feature = "ts", derive(TS))]
23267#[cfg_attr(feature = "ts", ts(export))]
23268pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
23269 #[doc = "System ID (0 for broadcast)."]
23270 pub target_system: u8,
23271 #[doc = "Component ID (0 for broadcast)."]
23272 pub target_component: u8,
23273 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23274 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23275 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23276 pub id_or_mac: [u8; 20],
23277 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
23278 pub single_message_size: u8,
23279 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
23280 pub msg_pack_size: u8,
23281 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
23282 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23283 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23284 pub messages: [u8; 225],
23285}
23286impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
23287 pub const ENCODED_LEN: usize = 249usize;
23288 pub const DEFAULT: Self = Self {
23289 target_system: 0_u8,
23290 target_component: 0_u8,
23291 id_or_mac: [0_u8; 20usize],
23292 single_message_size: 0_u8,
23293 msg_pack_size: 0_u8,
23294 messages: [0_u8; 225usize],
23295 };
23296 #[cfg(feature = "arbitrary")]
23297 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23298 use arbitrary::{Arbitrary, Unstructured};
23299 let mut buf = [0u8; 1024];
23300 rng.fill_bytes(&mut buf);
23301 let mut unstructured = Unstructured::new(&buf);
23302 Self::arbitrary(&mut unstructured).unwrap_or_default()
23303 }
23304}
23305impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
23306 fn default() -> Self {
23307 Self::DEFAULT.clone()
23308 }
23309}
23310impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
23311 type Message = MavMessage;
23312 const ID: u32 = 12915u32;
23313 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
23314 const EXTRA_CRC: u8 = 94u8;
23315 const ENCODED_LEN: usize = 249usize;
23316 fn deser(
23317 _version: MavlinkVersion,
23318 __input: &[u8],
23319 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23320 let avail_len = __input.len();
23321 let mut payload_buf = [0; Self::ENCODED_LEN];
23322 let mut buf = if avail_len < Self::ENCODED_LEN {
23323 payload_buf[0..avail_len].copy_from_slice(__input);
23324 Bytes::new(&payload_buf)
23325 } else {
23326 Bytes::new(__input)
23327 };
23328 let mut __struct = Self::default();
23329 __struct.target_system = buf.get_u8();
23330 __struct.target_component = buf.get_u8();
23331 for v in &mut __struct.id_or_mac {
23332 let val = buf.get_u8();
23333 *v = val;
23334 }
23335 __struct.single_message_size = buf.get_u8();
23336 __struct.msg_pack_size = buf.get_u8();
23337 for v in &mut __struct.messages {
23338 let val = buf.get_u8();
23339 *v = val;
23340 }
23341 Ok(__struct)
23342 }
23343 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23344 let mut __tmp = BytesMut::new(bytes);
23345 #[allow(clippy::absurd_extreme_comparisons)]
23346 #[allow(unused_comparisons)]
23347 if __tmp.remaining() < Self::ENCODED_LEN {
23348 panic!(
23349 "buffer is too small (need {} bytes, but got {})",
23350 Self::ENCODED_LEN,
23351 __tmp.remaining(),
23352 )
23353 }
23354 __tmp.put_u8(self.target_system);
23355 __tmp.put_u8(self.target_component);
23356 for val in &self.id_or_mac {
23357 __tmp.put_u8(*val);
23358 }
23359 __tmp.put_u8(self.single_message_size);
23360 __tmp.put_u8(self.msg_pack_size);
23361 for val in &self.messages {
23362 __tmp.put_u8(*val);
23363 }
23364 if matches!(version, MavlinkVersion::V2) {
23365 let len = __tmp.len();
23366 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23367 } else {
23368 __tmp.len()
23369 }
23370 }
23371}
23372#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
23373#[doc = ""]
23374#[doc = "ID: 12905"]
23375#[derive(Debug, Clone, PartialEq)]
23376#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23377#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23378#[cfg_attr(feature = "ts", derive(TS))]
23379#[cfg_attr(feature = "ts", ts(export))]
23380pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
23381 #[doc = "System ID (0 for broadcast)."]
23382 pub target_system: u8,
23383 #[doc = "Component ID (0 for broadcast)."]
23384 pub target_component: u8,
23385 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23386 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23387 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23388 pub id_or_mac: [u8; 20],
23389 #[doc = "Indicates the type of the operator_id field."]
23390 pub operator_id_type: MavOdidOperatorIdType,
23391 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
23392 #[cfg_attr(feature = "ts", ts(type = "string"))]
23393 pub operator_id: CharArray<20>,
23394}
23395impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
23396 pub const ENCODED_LEN: usize = 43usize;
23397 pub const DEFAULT: Self = Self {
23398 target_system: 0_u8,
23399 target_component: 0_u8,
23400 id_or_mac: [0_u8; 20usize],
23401 operator_id_type: MavOdidOperatorIdType::DEFAULT,
23402 operator_id: CharArray::new([0_u8; 20usize]),
23403 };
23404 #[cfg(feature = "arbitrary")]
23405 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23406 use arbitrary::{Arbitrary, Unstructured};
23407 let mut buf = [0u8; 1024];
23408 rng.fill_bytes(&mut buf);
23409 let mut unstructured = Unstructured::new(&buf);
23410 Self::arbitrary(&mut unstructured).unwrap_or_default()
23411 }
23412}
23413impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
23414 fn default() -> Self {
23415 Self::DEFAULT.clone()
23416 }
23417}
23418impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
23419 type Message = MavMessage;
23420 const ID: u32 = 12905u32;
23421 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
23422 const EXTRA_CRC: u8 = 49u8;
23423 const ENCODED_LEN: usize = 43usize;
23424 fn deser(
23425 _version: MavlinkVersion,
23426 __input: &[u8],
23427 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23428 let avail_len = __input.len();
23429 let mut payload_buf = [0; Self::ENCODED_LEN];
23430 let mut buf = if avail_len < Self::ENCODED_LEN {
23431 payload_buf[0..avail_len].copy_from_slice(__input);
23432 Bytes::new(&payload_buf)
23433 } else {
23434 Bytes::new(__input)
23435 };
23436 let mut __struct = Self::default();
23437 __struct.target_system = buf.get_u8();
23438 __struct.target_component = buf.get_u8();
23439 for v in &mut __struct.id_or_mac {
23440 let val = buf.get_u8();
23441 *v = val;
23442 }
23443 let tmp = buf.get_u8();
23444 __struct.operator_id_type =
23445 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23446 enum_type: "MavOdidOperatorIdType",
23447 value: tmp as u32,
23448 })?;
23449 let mut tmp = [0_u8; 20usize];
23450 for v in &mut tmp {
23451 *v = buf.get_u8();
23452 }
23453 __struct.operator_id = CharArray::new(tmp);
23454 Ok(__struct)
23455 }
23456 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23457 let mut __tmp = BytesMut::new(bytes);
23458 #[allow(clippy::absurd_extreme_comparisons)]
23459 #[allow(unused_comparisons)]
23460 if __tmp.remaining() < Self::ENCODED_LEN {
23461 panic!(
23462 "buffer is too small (need {} bytes, but got {})",
23463 Self::ENCODED_LEN,
23464 __tmp.remaining(),
23465 )
23466 }
23467 __tmp.put_u8(self.target_system);
23468 __tmp.put_u8(self.target_component);
23469 for val in &self.id_or_mac {
23470 __tmp.put_u8(*val);
23471 }
23472 __tmp.put_u8(self.operator_id_type as u8);
23473 for val in &self.operator_id {
23474 __tmp.put_u8(*val);
23475 }
23476 if matches!(version, MavlinkVersion::V2) {
23477 let len = __tmp.len();
23478 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23479 } else {
23480 __tmp.len()
23481 }
23482 }
23483}
23484#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
23485#[doc = ""]
23486#[doc = "ID: 12903"]
23487#[derive(Debug, Clone, PartialEq)]
23488#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23489#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23490#[cfg_attr(feature = "ts", derive(TS))]
23491#[cfg_attr(feature = "ts", ts(export))]
23492pub struct OPEN_DRONE_ID_SELF_ID_DATA {
23493 #[doc = "System ID (0 for broadcast)."]
23494 pub target_system: u8,
23495 #[doc = "Component ID (0 for broadcast)."]
23496 pub target_component: u8,
23497 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23498 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23499 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23500 pub id_or_mac: [u8; 20],
23501 #[doc = "Indicates the type of the description field."]
23502 pub description_type: MavOdidDescType,
23503 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
23504 #[cfg_attr(feature = "ts", ts(type = "string"))]
23505 pub description: CharArray<23>,
23506}
23507impl OPEN_DRONE_ID_SELF_ID_DATA {
23508 pub const ENCODED_LEN: usize = 46usize;
23509 pub const DEFAULT: Self = Self {
23510 target_system: 0_u8,
23511 target_component: 0_u8,
23512 id_or_mac: [0_u8; 20usize],
23513 description_type: MavOdidDescType::DEFAULT,
23514 description: CharArray::new([0_u8; 23usize]),
23515 };
23516 #[cfg(feature = "arbitrary")]
23517 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23518 use arbitrary::{Arbitrary, Unstructured};
23519 let mut buf = [0u8; 1024];
23520 rng.fill_bytes(&mut buf);
23521 let mut unstructured = Unstructured::new(&buf);
23522 Self::arbitrary(&mut unstructured).unwrap_or_default()
23523 }
23524}
23525impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
23526 fn default() -> Self {
23527 Self::DEFAULT.clone()
23528 }
23529}
23530impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
23531 type Message = MavMessage;
23532 const ID: u32 = 12903u32;
23533 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
23534 const EXTRA_CRC: u8 = 249u8;
23535 const ENCODED_LEN: usize = 46usize;
23536 fn deser(
23537 _version: MavlinkVersion,
23538 __input: &[u8],
23539 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23540 let avail_len = __input.len();
23541 let mut payload_buf = [0; Self::ENCODED_LEN];
23542 let mut buf = if avail_len < Self::ENCODED_LEN {
23543 payload_buf[0..avail_len].copy_from_slice(__input);
23544 Bytes::new(&payload_buf)
23545 } else {
23546 Bytes::new(__input)
23547 };
23548 let mut __struct = Self::default();
23549 __struct.target_system = buf.get_u8();
23550 __struct.target_component = buf.get_u8();
23551 for v in &mut __struct.id_or_mac {
23552 let val = buf.get_u8();
23553 *v = val;
23554 }
23555 let tmp = buf.get_u8();
23556 __struct.description_type =
23557 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23558 enum_type: "MavOdidDescType",
23559 value: tmp as u32,
23560 })?;
23561 let mut tmp = [0_u8; 23usize];
23562 for v in &mut tmp {
23563 *v = buf.get_u8();
23564 }
23565 __struct.description = CharArray::new(tmp);
23566 Ok(__struct)
23567 }
23568 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23569 let mut __tmp = BytesMut::new(bytes);
23570 #[allow(clippy::absurd_extreme_comparisons)]
23571 #[allow(unused_comparisons)]
23572 if __tmp.remaining() < Self::ENCODED_LEN {
23573 panic!(
23574 "buffer is too small (need {} bytes, but got {})",
23575 Self::ENCODED_LEN,
23576 __tmp.remaining(),
23577 )
23578 }
23579 __tmp.put_u8(self.target_system);
23580 __tmp.put_u8(self.target_component);
23581 for val in &self.id_or_mac {
23582 __tmp.put_u8(*val);
23583 }
23584 __tmp.put_u8(self.description_type as u8);
23585 for val in &self.description {
23586 __tmp.put_u8(*val);
23587 }
23588 if matches!(version, MavlinkVersion::V2) {
23589 let len = __tmp.len();
23590 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23591 } else {
23592 __tmp.len()
23593 }
23594 }
23595}
23596#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
23597#[doc = ""]
23598#[doc = "ID: 12904"]
23599#[derive(Debug, Clone, PartialEq)]
23600#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23601#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23602#[cfg_attr(feature = "ts", derive(TS))]
23603#[cfg_attr(feature = "ts", ts(export))]
23604pub struct OPEN_DRONE_ID_SYSTEM_DATA {
23605 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
23606 pub operator_latitude: i32,
23607 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
23608 pub operator_longitude: i32,
23609 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
23610 pub area_ceiling: f32,
23611 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
23612 pub area_floor: f32,
23613 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
23614 pub operator_altitude_geo: f32,
23615 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
23616 pub timestamp: u32,
23617 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
23618 pub area_count: u16,
23619 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
23620 pub area_radius: u16,
23621 #[doc = "System ID (0 for broadcast)."]
23622 pub target_system: u8,
23623 #[doc = "Component ID (0 for broadcast)."]
23624 pub target_component: u8,
23625 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23626 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23627 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23628 pub id_or_mac: [u8; 20],
23629 #[doc = "Specifies the operator location type."]
23630 pub operator_location_type: MavOdidOperatorLocationType,
23631 #[doc = "Specifies the classification type of the UA."]
23632 pub classification_type: MavOdidClassificationType,
23633 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
23634 pub category_eu: MavOdidCategoryEu,
23635 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
23636 pub class_eu: MavOdidClassEu,
23637}
23638impl OPEN_DRONE_ID_SYSTEM_DATA {
23639 pub const ENCODED_LEN: usize = 54usize;
23640 pub const DEFAULT: Self = Self {
23641 operator_latitude: 0_i32,
23642 operator_longitude: 0_i32,
23643 area_ceiling: 0.0_f32,
23644 area_floor: 0.0_f32,
23645 operator_altitude_geo: 0.0_f32,
23646 timestamp: 0_u32,
23647 area_count: 0_u16,
23648 area_radius: 0_u16,
23649 target_system: 0_u8,
23650 target_component: 0_u8,
23651 id_or_mac: [0_u8; 20usize],
23652 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
23653 classification_type: MavOdidClassificationType::DEFAULT,
23654 category_eu: MavOdidCategoryEu::DEFAULT,
23655 class_eu: MavOdidClassEu::DEFAULT,
23656 };
23657 #[cfg(feature = "arbitrary")]
23658 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23659 use arbitrary::{Arbitrary, Unstructured};
23660 let mut buf = [0u8; 1024];
23661 rng.fill_bytes(&mut buf);
23662 let mut unstructured = Unstructured::new(&buf);
23663 Self::arbitrary(&mut unstructured).unwrap_or_default()
23664 }
23665}
23666impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
23667 fn default() -> Self {
23668 Self::DEFAULT.clone()
23669 }
23670}
23671impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
23672 type Message = MavMessage;
23673 const ID: u32 = 12904u32;
23674 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
23675 const EXTRA_CRC: u8 = 77u8;
23676 const ENCODED_LEN: usize = 54usize;
23677 fn deser(
23678 _version: MavlinkVersion,
23679 __input: &[u8],
23680 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23681 let avail_len = __input.len();
23682 let mut payload_buf = [0; Self::ENCODED_LEN];
23683 let mut buf = if avail_len < Self::ENCODED_LEN {
23684 payload_buf[0..avail_len].copy_from_slice(__input);
23685 Bytes::new(&payload_buf)
23686 } else {
23687 Bytes::new(__input)
23688 };
23689 let mut __struct = Self::default();
23690 __struct.operator_latitude = buf.get_i32_le();
23691 __struct.operator_longitude = buf.get_i32_le();
23692 __struct.area_ceiling = buf.get_f32_le();
23693 __struct.area_floor = buf.get_f32_le();
23694 __struct.operator_altitude_geo = buf.get_f32_le();
23695 __struct.timestamp = buf.get_u32_le();
23696 __struct.area_count = buf.get_u16_le();
23697 __struct.area_radius = buf.get_u16_le();
23698 __struct.target_system = buf.get_u8();
23699 __struct.target_component = buf.get_u8();
23700 for v in &mut __struct.id_or_mac {
23701 let val = buf.get_u8();
23702 *v = val;
23703 }
23704 let tmp = buf.get_u8();
23705 __struct.operator_location_type =
23706 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23707 enum_type: "MavOdidOperatorLocationType",
23708 value: tmp as u32,
23709 })?;
23710 let tmp = buf.get_u8();
23711 __struct.classification_type =
23712 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23713 enum_type: "MavOdidClassificationType",
23714 value: tmp as u32,
23715 })?;
23716 let tmp = buf.get_u8();
23717 __struct.category_eu =
23718 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23719 enum_type: "MavOdidCategoryEu",
23720 value: tmp as u32,
23721 })?;
23722 let tmp = buf.get_u8();
23723 __struct.class_eu =
23724 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23725 enum_type: "MavOdidClassEu",
23726 value: tmp as u32,
23727 })?;
23728 Ok(__struct)
23729 }
23730 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23731 let mut __tmp = BytesMut::new(bytes);
23732 #[allow(clippy::absurd_extreme_comparisons)]
23733 #[allow(unused_comparisons)]
23734 if __tmp.remaining() < Self::ENCODED_LEN {
23735 panic!(
23736 "buffer is too small (need {} bytes, but got {})",
23737 Self::ENCODED_LEN,
23738 __tmp.remaining(),
23739 )
23740 }
23741 __tmp.put_i32_le(self.operator_latitude);
23742 __tmp.put_i32_le(self.operator_longitude);
23743 __tmp.put_f32_le(self.area_ceiling);
23744 __tmp.put_f32_le(self.area_floor);
23745 __tmp.put_f32_le(self.operator_altitude_geo);
23746 __tmp.put_u32_le(self.timestamp);
23747 __tmp.put_u16_le(self.area_count);
23748 __tmp.put_u16_le(self.area_radius);
23749 __tmp.put_u8(self.target_system);
23750 __tmp.put_u8(self.target_component);
23751 for val in &self.id_or_mac {
23752 __tmp.put_u8(*val);
23753 }
23754 __tmp.put_u8(self.operator_location_type as u8);
23755 __tmp.put_u8(self.classification_type as u8);
23756 __tmp.put_u8(self.category_eu as u8);
23757 __tmp.put_u8(self.class_eu as u8);
23758 if matches!(version, MavlinkVersion::V2) {
23759 let len = __tmp.len();
23760 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23761 } else {
23762 __tmp.len()
23763 }
23764 }
23765}
23766#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
23767#[doc = ""]
23768#[doc = "ID: 12919"]
23769#[derive(Debug, Clone, PartialEq)]
23770#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23771#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23772#[cfg_attr(feature = "ts", derive(TS))]
23773#[cfg_attr(feature = "ts", ts(export))]
23774pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23775 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
23776 pub operator_latitude: i32,
23777 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
23778 pub operator_longitude: i32,
23779 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
23780 pub operator_altitude_geo: f32,
23781 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
23782 pub timestamp: u32,
23783 #[doc = "System ID (0 for broadcast)."]
23784 pub target_system: u8,
23785 #[doc = "Component ID (0 for broadcast)."]
23786 pub target_component: u8,
23787}
23788impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23789 pub const ENCODED_LEN: usize = 18usize;
23790 pub const DEFAULT: Self = Self {
23791 operator_latitude: 0_i32,
23792 operator_longitude: 0_i32,
23793 operator_altitude_geo: 0.0_f32,
23794 timestamp: 0_u32,
23795 target_system: 0_u8,
23796 target_component: 0_u8,
23797 };
23798 #[cfg(feature = "arbitrary")]
23799 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23800 use arbitrary::{Arbitrary, Unstructured};
23801 let mut buf = [0u8; 1024];
23802 rng.fill_bytes(&mut buf);
23803 let mut unstructured = Unstructured::new(&buf);
23804 Self::arbitrary(&mut unstructured).unwrap_or_default()
23805 }
23806}
23807impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23808 fn default() -> Self {
23809 Self::DEFAULT.clone()
23810 }
23811}
23812impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23813 type Message = MavMessage;
23814 const ID: u32 = 12919u32;
23815 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
23816 const EXTRA_CRC: u8 = 7u8;
23817 const ENCODED_LEN: usize = 18usize;
23818 fn deser(
23819 _version: MavlinkVersion,
23820 __input: &[u8],
23821 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23822 let avail_len = __input.len();
23823 let mut payload_buf = [0; Self::ENCODED_LEN];
23824 let mut buf = if avail_len < Self::ENCODED_LEN {
23825 payload_buf[0..avail_len].copy_from_slice(__input);
23826 Bytes::new(&payload_buf)
23827 } else {
23828 Bytes::new(__input)
23829 };
23830 let mut __struct = Self::default();
23831 __struct.operator_latitude = buf.get_i32_le();
23832 __struct.operator_longitude = buf.get_i32_le();
23833 __struct.operator_altitude_geo = buf.get_f32_le();
23834 __struct.timestamp = buf.get_u32_le();
23835 __struct.target_system = buf.get_u8();
23836 __struct.target_component = buf.get_u8();
23837 Ok(__struct)
23838 }
23839 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23840 let mut __tmp = BytesMut::new(bytes);
23841 #[allow(clippy::absurd_extreme_comparisons)]
23842 #[allow(unused_comparisons)]
23843 if __tmp.remaining() < Self::ENCODED_LEN {
23844 panic!(
23845 "buffer is too small (need {} bytes, but got {})",
23846 Self::ENCODED_LEN,
23847 __tmp.remaining(),
23848 )
23849 }
23850 __tmp.put_i32_le(self.operator_latitude);
23851 __tmp.put_i32_le(self.operator_longitude);
23852 __tmp.put_f32_le(self.operator_altitude_geo);
23853 __tmp.put_u32_le(self.timestamp);
23854 __tmp.put_u8(self.target_system);
23855 __tmp.put_u8(self.target_component);
23856 if matches!(version, MavlinkVersion::V2) {
23857 let len = __tmp.len();
23858 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23859 } else {
23860 __tmp.len()
23861 }
23862 }
23863}
23864#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
23865#[doc = ""]
23866#[doc = "ID: 100"]
23867#[derive(Debug, Clone, PartialEq)]
23868#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23870#[cfg_attr(feature = "ts", derive(TS))]
23871#[cfg_attr(feature = "ts", ts(export))]
23872pub struct OPTICAL_FLOW_DATA {
23873 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23874 pub time_usec: u64,
23875 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
23876 pub flow_comp_m_x: f32,
23877 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
23878 pub flow_comp_m_y: f32,
23879 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
23880 pub ground_distance: f32,
23881 #[doc = "Flow in x-sensor direction"]
23882 pub flow_x: i16,
23883 #[doc = "Flow in y-sensor direction"]
23884 pub flow_y: i16,
23885 #[doc = "Sensor ID"]
23886 pub sensor_id: u8,
23887 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
23888 pub quality: u8,
23889 #[doc = "Flow rate about X axis"]
23890 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23891 pub flow_rate_x: f32,
23892 #[doc = "Flow rate about Y axis"]
23893 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23894 pub flow_rate_y: f32,
23895}
23896impl OPTICAL_FLOW_DATA {
23897 pub const ENCODED_LEN: usize = 34usize;
23898 pub const DEFAULT: Self = Self {
23899 time_usec: 0_u64,
23900 flow_comp_m_x: 0.0_f32,
23901 flow_comp_m_y: 0.0_f32,
23902 ground_distance: 0.0_f32,
23903 flow_x: 0_i16,
23904 flow_y: 0_i16,
23905 sensor_id: 0_u8,
23906 quality: 0_u8,
23907 flow_rate_x: 0.0_f32,
23908 flow_rate_y: 0.0_f32,
23909 };
23910 #[cfg(feature = "arbitrary")]
23911 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23912 use arbitrary::{Arbitrary, Unstructured};
23913 let mut buf = [0u8; 1024];
23914 rng.fill_bytes(&mut buf);
23915 let mut unstructured = Unstructured::new(&buf);
23916 Self::arbitrary(&mut unstructured).unwrap_or_default()
23917 }
23918}
23919impl Default for OPTICAL_FLOW_DATA {
23920 fn default() -> Self {
23921 Self::DEFAULT.clone()
23922 }
23923}
23924impl MessageData for OPTICAL_FLOW_DATA {
23925 type Message = MavMessage;
23926 const ID: u32 = 100u32;
23927 const NAME: &'static str = "OPTICAL_FLOW";
23928 const EXTRA_CRC: u8 = 175u8;
23929 const ENCODED_LEN: usize = 34usize;
23930 fn deser(
23931 _version: MavlinkVersion,
23932 __input: &[u8],
23933 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23934 let avail_len = __input.len();
23935 let mut payload_buf = [0; Self::ENCODED_LEN];
23936 let mut buf = if avail_len < Self::ENCODED_LEN {
23937 payload_buf[0..avail_len].copy_from_slice(__input);
23938 Bytes::new(&payload_buf)
23939 } else {
23940 Bytes::new(__input)
23941 };
23942 let mut __struct = Self::default();
23943 __struct.time_usec = buf.get_u64_le();
23944 __struct.flow_comp_m_x = buf.get_f32_le();
23945 __struct.flow_comp_m_y = buf.get_f32_le();
23946 __struct.ground_distance = buf.get_f32_le();
23947 __struct.flow_x = buf.get_i16_le();
23948 __struct.flow_y = buf.get_i16_le();
23949 __struct.sensor_id = buf.get_u8();
23950 __struct.quality = buf.get_u8();
23951 __struct.flow_rate_x = buf.get_f32_le();
23952 __struct.flow_rate_y = buf.get_f32_le();
23953 Ok(__struct)
23954 }
23955 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23956 let mut __tmp = BytesMut::new(bytes);
23957 #[allow(clippy::absurd_extreme_comparisons)]
23958 #[allow(unused_comparisons)]
23959 if __tmp.remaining() < Self::ENCODED_LEN {
23960 panic!(
23961 "buffer is too small (need {} bytes, but got {})",
23962 Self::ENCODED_LEN,
23963 __tmp.remaining(),
23964 )
23965 }
23966 __tmp.put_u64_le(self.time_usec);
23967 __tmp.put_f32_le(self.flow_comp_m_x);
23968 __tmp.put_f32_le(self.flow_comp_m_y);
23969 __tmp.put_f32_le(self.ground_distance);
23970 __tmp.put_i16_le(self.flow_x);
23971 __tmp.put_i16_le(self.flow_y);
23972 __tmp.put_u8(self.sensor_id);
23973 __tmp.put_u8(self.quality);
23974 if matches!(version, MavlinkVersion::V2) {
23975 __tmp.put_f32_le(self.flow_rate_x);
23976 __tmp.put_f32_le(self.flow_rate_y);
23977 let len = __tmp.len();
23978 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23979 } else {
23980 __tmp.len()
23981 }
23982 }
23983}
23984#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
23985#[doc = ""]
23986#[doc = "ID: 106"]
23987#[derive(Debug, Clone, PartialEq)]
23988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23989#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23990#[cfg_attr(feature = "ts", derive(TS))]
23991#[cfg_attr(feature = "ts", ts(export))]
23992pub struct OPTICAL_FLOW_RAD_DATA {
23993 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23994 pub time_usec: u64,
23995 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
23996 pub integration_time_us: u32,
23997 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
23998 pub integrated_x: f32,
23999 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
24000 pub integrated_y: f32,
24001 #[doc = "RH rotation around X axis"]
24002 pub integrated_xgyro: f32,
24003 #[doc = "RH rotation around Y axis"]
24004 pub integrated_ygyro: f32,
24005 #[doc = "RH rotation around Z axis"]
24006 pub integrated_zgyro: f32,
24007 #[doc = "Time since the distance was sampled."]
24008 pub time_delta_distance_us: u32,
24009 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
24010 pub distance: f32,
24011 #[doc = "Temperature"]
24012 pub temperature: i16,
24013 #[doc = "Sensor ID"]
24014 pub sensor_id: u8,
24015 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
24016 pub quality: u8,
24017}
24018impl OPTICAL_FLOW_RAD_DATA {
24019 pub const ENCODED_LEN: usize = 44usize;
24020 pub const DEFAULT: Self = Self {
24021 time_usec: 0_u64,
24022 integration_time_us: 0_u32,
24023 integrated_x: 0.0_f32,
24024 integrated_y: 0.0_f32,
24025 integrated_xgyro: 0.0_f32,
24026 integrated_ygyro: 0.0_f32,
24027 integrated_zgyro: 0.0_f32,
24028 time_delta_distance_us: 0_u32,
24029 distance: 0.0_f32,
24030 temperature: 0_i16,
24031 sensor_id: 0_u8,
24032 quality: 0_u8,
24033 };
24034 #[cfg(feature = "arbitrary")]
24035 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24036 use arbitrary::{Arbitrary, Unstructured};
24037 let mut buf = [0u8; 1024];
24038 rng.fill_bytes(&mut buf);
24039 let mut unstructured = Unstructured::new(&buf);
24040 Self::arbitrary(&mut unstructured).unwrap_or_default()
24041 }
24042}
24043impl Default for OPTICAL_FLOW_RAD_DATA {
24044 fn default() -> Self {
24045 Self::DEFAULT.clone()
24046 }
24047}
24048impl MessageData for OPTICAL_FLOW_RAD_DATA {
24049 type Message = MavMessage;
24050 const ID: u32 = 106u32;
24051 const NAME: &'static str = "OPTICAL_FLOW_RAD";
24052 const EXTRA_CRC: u8 = 138u8;
24053 const ENCODED_LEN: usize = 44usize;
24054 fn deser(
24055 _version: MavlinkVersion,
24056 __input: &[u8],
24057 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24058 let avail_len = __input.len();
24059 let mut payload_buf = [0; Self::ENCODED_LEN];
24060 let mut buf = if avail_len < Self::ENCODED_LEN {
24061 payload_buf[0..avail_len].copy_from_slice(__input);
24062 Bytes::new(&payload_buf)
24063 } else {
24064 Bytes::new(__input)
24065 };
24066 let mut __struct = Self::default();
24067 __struct.time_usec = buf.get_u64_le();
24068 __struct.integration_time_us = buf.get_u32_le();
24069 __struct.integrated_x = buf.get_f32_le();
24070 __struct.integrated_y = buf.get_f32_le();
24071 __struct.integrated_xgyro = buf.get_f32_le();
24072 __struct.integrated_ygyro = buf.get_f32_le();
24073 __struct.integrated_zgyro = buf.get_f32_le();
24074 __struct.time_delta_distance_us = buf.get_u32_le();
24075 __struct.distance = buf.get_f32_le();
24076 __struct.temperature = buf.get_i16_le();
24077 __struct.sensor_id = buf.get_u8();
24078 __struct.quality = buf.get_u8();
24079 Ok(__struct)
24080 }
24081 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24082 let mut __tmp = BytesMut::new(bytes);
24083 #[allow(clippy::absurd_extreme_comparisons)]
24084 #[allow(unused_comparisons)]
24085 if __tmp.remaining() < Self::ENCODED_LEN {
24086 panic!(
24087 "buffer is too small (need {} bytes, but got {})",
24088 Self::ENCODED_LEN,
24089 __tmp.remaining(),
24090 )
24091 }
24092 __tmp.put_u64_le(self.time_usec);
24093 __tmp.put_u32_le(self.integration_time_us);
24094 __tmp.put_f32_le(self.integrated_x);
24095 __tmp.put_f32_le(self.integrated_y);
24096 __tmp.put_f32_le(self.integrated_xgyro);
24097 __tmp.put_f32_le(self.integrated_ygyro);
24098 __tmp.put_f32_le(self.integrated_zgyro);
24099 __tmp.put_u32_le(self.time_delta_distance_us);
24100 __tmp.put_f32_le(self.distance);
24101 __tmp.put_i16_le(self.temperature);
24102 __tmp.put_u8(self.sensor_id);
24103 __tmp.put_u8(self.quality);
24104 if matches!(version, MavlinkVersion::V2) {
24105 let len = __tmp.len();
24106 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24107 } else {
24108 __tmp.len()
24109 }
24110 }
24111}
24112#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
24113#[doc = ""]
24114#[doc = "ID: 360"]
24115#[derive(Debug, Clone, PartialEq)]
24116#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24117#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24118#[cfg_attr(feature = "ts", derive(TS))]
24119#[cfg_attr(feature = "ts", ts(export))]
24120pub struct ORBIT_EXECUTION_STATUS_DATA {
24121 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24122 pub time_usec: u64,
24123 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
24124 pub radius: f32,
24125 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
24126 pub x: i32,
24127 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
24128 pub y: i32,
24129 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
24130 pub z: f32,
24131 #[doc = "The coordinate system of the fields: x, y, z."]
24132 pub frame: MavFrame,
24133}
24134impl ORBIT_EXECUTION_STATUS_DATA {
24135 pub const ENCODED_LEN: usize = 25usize;
24136 pub const DEFAULT: Self = Self {
24137 time_usec: 0_u64,
24138 radius: 0.0_f32,
24139 x: 0_i32,
24140 y: 0_i32,
24141 z: 0.0_f32,
24142 frame: MavFrame::DEFAULT,
24143 };
24144 #[cfg(feature = "arbitrary")]
24145 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24146 use arbitrary::{Arbitrary, Unstructured};
24147 let mut buf = [0u8; 1024];
24148 rng.fill_bytes(&mut buf);
24149 let mut unstructured = Unstructured::new(&buf);
24150 Self::arbitrary(&mut unstructured).unwrap_or_default()
24151 }
24152}
24153impl Default for ORBIT_EXECUTION_STATUS_DATA {
24154 fn default() -> Self {
24155 Self::DEFAULT.clone()
24156 }
24157}
24158impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
24159 type Message = MavMessage;
24160 const ID: u32 = 360u32;
24161 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
24162 const EXTRA_CRC: u8 = 11u8;
24163 const ENCODED_LEN: usize = 25usize;
24164 fn deser(
24165 _version: MavlinkVersion,
24166 __input: &[u8],
24167 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24168 let avail_len = __input.len();
24169 let mut payload_buf = [0; Self::ENCODED_LEN];
24170 let mut buf = if avail_len < Self::ENCODED_LEN {
24171 payload_buf[0..avail_len].copy_from_slice(__input);
24172 Bytes::new(&payload_buf)
24173 } else {
24174 Bytes::new(__input)
24175 };
24176 let mut __struct = Self::default();
24177 __struct.time_usec = buf.get_u64_le();
24178 __struct.radius = buf.get_f32_le();
24179 __struct.x = buf.get_i32_le();
24180 __struct.y = buf.get_i32_le();
24181 __struct.z = buf.get_f32_le();
24182 let tmp = buf.get_u8();
24183 __struct.frame =
24184 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24185 enum_type: "MavFrame",
24186 value: tmp as u32,
24187 })?;
24188 Ok(__struct)
24189 }
24190 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24191 let mut __tmp = BytesMut::new(bytes);
24192 #[allow(clippy::absurd_extreme_comparisons)]
24193 #[allow(unused_comparisons)]
24194 if __tmp.remaining() < Self::ENCODED_LEN {
24195 panic!(
24196 "buffer is too small (need {} bytes, but got {})",
24197 Self::ENCODED_LEN,
24198 __tmp.remaining(),
24199 )
24200 }
24201 __tmp.put_u64_le(self.time_usec);
24202 __tmp.put_f32_le(self.radius);
24203 __tmp.put_i32_le(self.x);
24204 __tmp.put_i32_le(self.y);
24205 __tmp.put_f32_le(self.z);
24206 __tmp.put_u8(self.frame as u8);
24207 if matches!(version, MavlinkVersion::V2) {
24208 let len = __tmp.len();
24209 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24210 } else {
24211 __tmp.len()
24212 }
24213 }
24214}
24215#[doc = "Response from a PARAM_EXT_SET message."]
24216#[doc = ""]
24217#[doc = "ID: 324"]
24218#[derive(Debug, Clone, PartialEq)]
24219#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24220#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24221#[cfg_attr(feature = "ts", derive(TS))]
24222#[cfg_attr(feature = "ts", ts(export))]
24223pub struct PARAM_EXT_ACK_DATA {
24224 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24225 #[cfg_attr(feature = "ts", ts(type = "string"))]
24226 pub param_id: CharArray<16>,
24227 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
24228 #[cfg_attr(feature = "ts", ts(type = "string"))]
24229 pub param_value: CharArray<128>,
24230 #[doc = "Parameter type."]
24231 pub param_type: MavParamExtType,
24232 #[doc = "Result code."]
24233 pub param_result: ParamAck,
24234}
24235impl PARAM_EXT_ACK_DATA {
24236 pub const ENCODED_LEN: usize = 146usize;
24237 pub const DEFAULT: Self = Self {
24238 param_id: CharArray::new([0_u8; 16usize]),
24239 param_value: CharArray::new([0_u8; 128usize]),
24240 param_type: MavParamExtType::DEFAULT,
24241 param_result: ParamAck::DEFAULT,
24242 };
24243 #[cfg(feature = "arbitrary")]
24244 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24245 use arbitrary::{Arbitrary, Unstructured};
24246 let mut buf = [0u8; 1024];
24247 rng.fill_bytes(&mut buf);
24248 let mut unstructured = Unstructured::new(&buf);
24249 Self::arbitrary(&mut unstructured).unwrap_or_default()
24250 }
24251}
24252impl Default for PARAM_EXT_ACK_DATA {
24253 fn default() -> Self {
24254 Self::DEFAULT.clone()
24255 }
24256}
24257impl MessageData for PARAM_EXT_ACK_DATA {
24258 type Message = MavMessage;
24259 const ID: u32 = 324u32;
24260 const NAME: &'static str = "PARAM_EXT_ACK";
24261 const EXTRA_CRC: u8 = 132u8;
24262 const ENCODED_LEN: usize = 146usize;
24263 fn deser(
24264 _version: MavlinkVersion,
24265 __input: &[u8],
24266 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24267 let avail_len = __input.len();
24268 let mut payload_buf = [0; Self::ENCODED_LEN];
24269 let mut buf = if avail_len < Self::ENCODED_LEN {
24270 payload_buf[0..avail_len].copy_from_slice(__input);
24271 Bytes::new(&payload_buf)
24272 } else {
24273 Bytes::new(__input)
24274 };
24275 let mut __struct = Self::default();
24276 let mut tmp = [0_u8; 16usize];
24277 for v in &mut tmp {
24278 *v = buf.get_u8();
24279 }
24280 __struct.param_id = CharArray::new(tmp);
24281 let mut tmp = [0_u8; 128usize];
24282 for v in &mut tmp {
24283 *v = buf.get_u8();
24284 }
24285 __struct.param_value = CharArray::new(tmp);
24286 let tmp = buf.get_u8();
24287 __struct.param_type =
24288 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24289 enum_type: "MavParamExtType",
24290 value: tmp as u32,
24291 })?;
24292 let tmp = buf.get_u8();
24293 __struct.param_result =
24294 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24295 enum_type: "ParamAck",
24296 value: tmp as u32,
24297 })?;
24298 Ok(__struct)
24299 }
24300 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24301 let mut __tmp = BytesMut::new(bytes);
24302 #[allow(clippy::absurd_extreme_comparisons)]
24303 #[allow(unused_comparisons)]
24304 if __tmp.remaining() < Self::ENCODED_LEN {
24305 panic!(
24306 "buffer is too small (need {} bytes, but got {})",
24307 Self::ENCODED_LEN,
24308 __tmp.remaining(),
24309 )
24310 }
24311 for val in &self.param_id {
24312 __tmp.put_u8(*val);
24313 }
24314 for val in &self.param_value {
24315 __tmp.put_u8(*val);
24316 }
24317 __tmp.put_u8(self.param_type as u8);
24318 __tmp.put_u8(self.param_result as u8);
24319 if matches!(version, MavlinkVersion::V2) {
24320 let len = __tmp.len();
24321 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24322 } else {
24323 __tmp.len()
24324 }
24325 }
24326}
24327#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
24328#[doc = ""]
24329#[doc = "ID: 321"]
24330#[derive(Debug, Clone, PartialEq)]
24331#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24332#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24333#[cfg_attr(feature = "ts", derive(TS))]
24334#[cfg_attr(feature = "ts", ts(export))]
24335pub struct PARAM_EXT_REQUEST_LIST_DATA {
24336 #[doc = "System ID"]
24337 pub target_system: u8,
24338 #[doc = "Component ID"]
24339 pub target_component: u8,
24340}
24341impl PARAM_EXT_REQUEST_LIST_DATA {
24342 pub const ENCODED_LEN: usize = 2usize;
24343 pub const DEFAULT: Self = Self {
24344 target_system: 0_u8,
24345 target_component: 0_u8,
24346 };
24347 #[cfg(feature = "arbitrary")]
24348 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24349 use arbitrary::{Arbitrary, Unstructured};
24350 let mut buf = [0u8; 1024];
24351 rng.fill_bytes(&mut buf);
24352 let mut unstructured = Unstructured::new(&buf);
24353 Self::arbitrary(&mut unstructured).unwrap_or_default()
24354 }
24355}
24356impl Default for PARAM_EXT_REQUEST_LIST_DATA {
24357 fn default() -> Self {
24358 Self::DEFAULT.clone()
24359 }
24360}
24361impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
24362 type Message = MavMessage;
24363 const ID: u32 = 321u32;
24364 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
24365 const EXTRA_CRC: u8 = 88u8;
24366 const ENCODED_LEN: usize = 2usize;
24367 fn deser(
24368 _version: MavlinkVersion,
24369 __input: &[u8],
24370 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24371 let avail_len = __input.len();
24372 let mut payload_buf = [0; Self::ENCODED_LEN];
24373 let mut buf = if avail_len < Self::ENCODED_LEN {
24374 payload_buf[0..avail_len].copy_from_slice(__input);
24375 Bytes::new(&payload_buf)
24376 } else {
24377 Bytes::new(__input)
24378 };
24379 let mut __struct = Self::default();
24380 __struct.target_system = buf.get_u8();
24381 __struct.target_component = buf.get_u8();
24382 Ok(__struct)
24383 }
24384 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24385 let mut __tmp = BytesMut::new(bytes);
24386 #[allow(clippy::absurd_extreme_comparisons)]
24387 #[allow(unused_comparisons)]
24388 if __tmp.remaining() < Self::ENCODED_LEN {
24389 panic!(
24390 "buffer is too small (need {} bytes, but got {})",
24391 Self::ENCODED_LEN,
24392 __tmp.remaining(),
24393 )
24394 }
24395 __tmp.put_u8(self.target_system);
24396 __tmp.put_u8(self.target_component);
24397 if matches!(version, MavlinkVersion::V2) {
24398 let len = __tmp.len();
24399 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24400 } else {
24401 __tmp.len()
24402 }
24403 }
24404}
24405#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
24406#[doc = ""]
24407#[doc = "ID: 320"]
24408#[derive(Debug, Clone, PartialEq)]
24409#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24410#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24411#[cfg_attr(feature = "ts", derive(TS))]
24412#[cfg_attr(feature = "ts", ts(export))]
24413pub struct PARAM_EXT_REQUEST_READ_DATA {
24414 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
24415 pub param_index: i16,
24416 #[doc = "System ID"]
24417 pub target_system: u8,
24418 #[doc = "Component ID"]
24419 pub target_component: u8,
24420 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24421 #[cfg_attr(feature = "ts", ts(type = "string"))]
24422 pub param_id: CharArray<16>,
24423}
24424impl PARAM_EXT_REQUEST_READ_DATA {
24425 pub const ENCODED_LEN: usize = 20usize;
24426 pub const DEFAULT: Self = Self {
24427 param_index: 0_i16,
24428 target_system: 0_u8,
24429 target_component: 0_u8,
24430 param_id: CharArray::new([0_u8; 16usize]),
24431 };
24432 #[cfg(feature = "arbitrary")]
24433 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24434 use arbitrary::{Arbitrary, Unstructured};
24435 let mut buf = [0u8; 1024];
24436 rng.fill_bytes(&mut buf);
24437 let mut unstructured = Unstructured::new(&buf);
24438 Self::arbitrary(&mut unstructured).unwrap_or_default()
24439 }
24440}
24441impl Default for PARAM_EXT_REQUEST_READ_DATA {
24442 fn default() -> Self {
24443 Self::DEFAULT.clone()
24444 }
24445}
24446impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
24447 type Message = MavMessage;
24448 const ID: u32 = 320u32;
24449 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
24450 const EXTRA_CRC: u8 = 243u8;
24451 const ENCODED_LEN: usize = 20usize;
24452 fn deser(
24453 _version: MavlinkVersion,
24454 __input: &[u8],
24455 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24456 let avail_len = __input.len();
24457 let mut payload_buf = [0; Self::ENCODED_LEN];
24458 let mut buf = if avail_len < Self::ENCODED_LEN {
24459 payload_buf[0..avail_len].copy_from_slice(__input);
24460 Bytes::new(&payload_buf)
24461 } else {
24462 Bytes::new(__input)
24463 };
24464 let mut __struct = Self::default();
24465 __struct.param_index = buf.get_i16_le();
24466 __struct.target_system = buf.get_u8();
24467 __struct.target_component = buf.get_u8();
24468 let mut tmp = [0_u8; 16usize];
24469 for v in &mut tmp {
24470 *v = buf.get_u8();
24471 }
24472 __struct.param_id = CharArray::new(tmp);
24473 Ok(__struct)
24474 }
24475 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24476 let mut __tmp = BytesMut::new(bytes);
24477 #[allow(clippy::absurd_extreme_comparisons)]
24478 #[allow(unused_comparisons)]
24479 if __tmp.remaining() < Self::ENCODED_LEN {
24480 panic!(
24481 "buffer is too small (need {} bytes, but got {})",
24482 Self::ENCODED_LEN,
24483 __tmp.remaining(),
24484 )
24485 }
24486 __tmp.put_i16_le(self.param_index);
24487 __tmp.put_u8(self.target_system);
24488 __tmp.put_u8(self.target_component);
24489 for val in &self.param_id {
24490 __tmp.put_u8(*val);
24491 }
24492 if matches!(version, MavlinkVersion::V2) {
24493 let len = __tmp.len();
24494 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24495 } else {
24496 __tmp.len()
24497 }
24498 }
24499}
24500#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
24501#[doc = ""]
24502#[doc = "ID: 323"]
24503#[derive(Debug, Clone, PartialEq)]
24504#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24505#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24506#[cfg_attr(feature = "ts", derive(TS))]
24507#[cfg_attr(feature = "ts", ts(export))]
24508pub struct PARAM_EXT_SET_DATA {
24509 #[doc = "System ID"]
24510 pub target_system: u8,
24511 #[doc = "Component ID"]
24512 pub target_component: u8,
24513 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24514 #[cfg_attr(feature = "ts", ts(type = "string"))]
24515 pub param_id: CharArray<16>,
24516 #[doc = "Parameter value"]
24517 #[cfg_attr(feature = "ts", ts(type = "string"))]
24518 pub param_value: CharArray<128>,
24519 #[doc = "Parameter type."]
24520 pub param_type: MavParamExtType,
24521}
24522impl PARAM_EXT_SET_DATA {
24523 pub const ENCODED_LEN: usize = 147usize;
24524 pub const DEFAULT: Self = Self {
24525 target_system: 0_u8,
24526 target_component: 0_u8,
24527 param_id: CharArray::new([0_u8; 16usize]),
24528 param_value: CharArray::new([0_u8; 128usize]),
24529 param_type: MavParamExtType::DEFAULT,
24530 };
24531 #[cfg(feature = "arbitrary")]
24532 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24533 use arbitrary::{Arbitrary, Unstructured};
24534 let mut buf = [0u8; 1024];
24535 rng.fill_bytes(&mut buf);
24536 let mut unstructured = Unstructured::new(&buf);
24537 Self::arbitrary(&mut unstructured).unwrap_or_default()
24538 }
24539}
24540impl Default for PARAM_EXT_SET_DATA {
24541 fn default() -> Self {
24542 Self::DEFAULT.clone()
24543 }
24544}
24545impl MessageData for PARAM_EXT_SET_DATA {
24546 type Message = MavMessage;
24547 const ID: u32 = 323u32;
24548 const NAME: &'static str = "PARAM_EXT_SET";
24549 const EXTRA_CRC: u8 = 78u8;
24550 const ENCODED_LEN: usize = 147usize;
24551 fn deser(
24552 _version: MavlinkVersion,
24553 __input: &[u8],
24554 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24555 let avail_len = __input.len();
24556 let mut payload_buf = [0; Self::ENCODED_LEN];
24557 let mut buf = if avail_len < Self::ENCODED_LEN {
24558 payload_buf[0..avail_len].copy_from_slice(__input);
24559 Bytes::new(&payload_buf)
24560 } else {
24561 Bytes::new(__input)
24562 };
24563 let mut __struct = Self::default();
24564 __struct.target_system = buf.get_u8();
24565 __struct.target_component = buf.get_u8();
24566 let mut tmp = [0_u8; 16usize];
24567 for v in &mut tmp {
24568 *v = buf.get_u8();
24569 }
24570 __struct.param_id = CharArray::new(tmp);
24571 let mut tmp = [0_u8; 128usize];
24572 for v in &mut tmp {
24573 *v = buf.get_u8();
24574 }
24575 __struct.param_value = CharArray::new(tmp);
24576 let tmp = buf.get_u8();
24577 __struct.param_type =
24578 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24579 enum_type: "MavParamExtType",
24580 value: tmp as u32,
24581 })?;
24582 Ok(__struct)
24583 }
24584 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24585 let mut __tmp = BytesMut::new(bytes);
24586 #[allow(clippy::absurd_extreme_comparisons)]
24587 #[allow(unused_comparisons)]
24588 if __tmp.remaining() < Self::ENCODED_LEN {
24589 panic!(
24590 "buffer is too small (need {} bytes, but got {})",
24591 Self::ENCODED_LEN,
24592 __tmp.remaining(),
24593 )
24594 }
24595 __tmp.put_u8(self.target_system);
24596 __tmp.put_u8(self.target_component);
24597 for val in &self.param_id {
24598 __tmp.put_u8(*val);
24599 }
24600 for val in &self.param_value {
24601 __tmp.put_u8(*val);
24602 }
24603 __tmp.put_u8(self.param_type as u8);
24604 if matches!(version, MavlinkVersion::V2) {
24605 let len = __tmp.len();
24606 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24607 } else {
24608 __tmp.len()
24609 }
24610 }
24611}
24612#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
24613#[doc = ""]
24614#[doc = "ID: 322"]
24615#[derive(Debug, Clone, PartialEq)]
24616#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24617#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24618#[cfg_attr(feature = "ts", derive(TS))]
24619#[cfg_attr(feature = "ts", ts(export))]
24620pub struct PARAM_EXT_VALUE_DATA {
24621 #[doc = "Total number of parameters"]
24622 pub param_count: u16,
24623 #[doc = "Index of this parameter"]
24624 pub param_index: u16,
24625 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24626 #[cfg_attr(feature = "ts", ts(type = "string"))]
24627 pub param_id: CharArray<16>,
24628 #[doc = "Parameter value"]
24629 #[cfg_attr(feature = "ts", ts(type = "string"))]
24630 pub param_value: CharArray<128>,
24631 #[doc = "Parameter type."]
24632 pub param_type: MavParamExtType,
24633}
24634impl PARAM_EXT_VALUE_DATA {
24635 pub const ENCODED_LEN: usize = 149usize;
24636 pub const DEFAULT: Self = Self {
24637 param_count: 0_u16,
24638 param_index: 0_u16,
24639 param_id: CharArray::new([0_u8; 16usize]),
24640 param_value: CharArray::new([0_u8; 128usize]),
24641 param_type: MavParamExtType::DEFAULT,
24642 };
24643 #[cfg(feature = "arbitrary")]
24644 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24645 use arbitrary::{Arbitrary, Unstructured};
24646 let mut buf = [0u8; 1024];
24647 rng.fill_bytes(&mut buf);
24648 let mut unstructured = Unstructured::new(&buf);
24649 Self::arbitrary(&mut unstructured).unwrap_or_default()
24650 }
24651}
24652impl Default for PARAM_EXT_VALUE_DATA {
24653 fn default() -> Self {
24654 Self::DEFAULT.clone()
24655 }
24656}
24657impl MessageData for PARAM_EXT_VALUE_DATA {
24658 type Message = MavMessage;
24659 const ID: u32 = 322u32;
24660 const NAME: &'static str = "PARAM_EXT_VALUE";
24661 const EXTRA_CRC: u8 = 243u8;
24662 const ENCODED_LEN: usize = 149usize;
24663 fn deser(
24664 _version: MavlinkVersion,
24665 __input: &[u8],
24666 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24667 let avail_len = __input.len();
24668 let mut payload_buf = [0; Self::ENCODED_LEN];
24669 let mut buf = if avail_len < Self::ENCODED_LEN {
24670 payload_buf[0..avail_len].copy_from_slice(__input);
24671 Bytes::new(&payload_buf)
24672 } else {
24673 Bytes::new(__input)
24674 };
24675 let mut __struct = Self::default();
24676 __struct.param_count = buf.get_u16_le();
24677 __struct.param_index = buf.get_u16_le();
24678 let mut tmp = [0_u8; 16usize];
24679 for v in &mut tmp {
24680 *v = buf.get_u8();
24681 }
24682 __struct.param_id = CharArray::new(tmp);
24683 let mut tmp = [0_u8; 128usize];
24684 for v in &mut tmp {
24685 *v = buf.get_u8();
24686 }
24687 __struct.param_value = CharArray::new(tmp);
24688 let tmp = buf.get_u8();
24689 __struct.param_type =
24690 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24691 enum_type: "MavParamExtType",
24692 value: tmp as u32,
24693 })?;
24694 Ok(__struct)
24695 }
24696 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24697 let mut __tmp = BytesMut::new(bytes);
24698 #[allow(clippy::absurd_extreme_comparisons)]
24699 #[allow(unused_comparisons)]
24700 if __tmp.remaining() < Self::ENCODED_LEN {
24701 panic!(
24702 "buffer is too small (need {} bytes, but got {})",
24703 Self::ENCODED_LEN,
24704 __tmp.remaining(),
24705 )
24706 }
24707 __tmp.put_u16_le(self.param_count);
24708 __tmp.put_u16_le(self.param_index);
24709 for val in &self.param_id {
24710 __tmp.put_u8(*val);
24711 }
24712 for val in &self.param_value {
24713 __tmp.put_u8(*val);
24714 }
24715 __tmp.put_u8(self.param_type as u8);
24716 if matches!(version, MavlinkVersion::V2) {
24717 let len = __tmp.len();
24718 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24719 } else {
24720 __tmp.len()
24721 }
24722 }
24723}
24724#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
24725#[doc = ""]
24726#[doc = "ID: 50"]
24727#[derive(Debug, Clone, PartialEq)]
24728#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24729#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24730#[cfg_attr(feature = "ts", derive(TS))]
24731#[cfg_attr(feature = "ts", ts(export))]
24732pub struct PARAM_MAP_RC_DATA {
24733 #[doc = "Initial parameter value"]
24734 pub param_value0: f32,
24735 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
24736 pub scale: f32,
24737 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
24738 pub param_value_min: f32,
24739 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
24740 pub param_value_max: f32,
24741 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
24742 pub param_index: i16,
24743 #[doc = "System ID"]
24744 pub target_system: u8,
24745 #[doc = "Component ID"]
24746 pub target_component: u8,
24747 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24748 #[cfg_attr(feature = "ts", ts(type = "string"))]
24749 pub param_id: CharArray<16>,
24750 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
24751 pub parameter_rc_channel_index: u8,
24752}
24753impl PARAM_MAP_RC_DATA {
24754 pub const ENCODED_LEN: usize = 37usize;
24755 pub const DEFAULT: Self = Self {
24756 param_value0: 0.0_f32,
24757 scale: 0.0_f32,
24758 param_value_min: 0.0_f32,
24759 param_value_max: 0.0_f32,
24760 param_index: 0_i16,
24761 target_system: 0_u8,
24762 target_component: 0_u8,
24763 param_id: CharArray::new([0_u8; 16usize]),
24764 parameter_rc_channel_index: 0_u8,
24765 };
24766 #[cfg(feature = "arbitrary")]
24767 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24768 use arbitrary::{Arbitrary, Unstructured};
24769 let mut buf = [0u8; 1024];
24770 rng.fill_bytes(&mut buf);
24771 let mut unstructured = Unstructured::new(&buf);
24772 Self::arbitrary(&mut unstructured).unwrap_or_default()
24773 }
24774}
24775impl Default for PARAM_MAP_RC_DATA {
24776 fn default() -> Self {
24777 Self::DEFAULT.clone()
24778 }
24779}
24780impl MessageData for PARAM_MAP_RC_DATA {
24781 type Message = MavMessage;
24782 const ID: u32 = 50u32;
24783 const NAME: &'static str = "PARAM_MAP_RC";
24784 const EXTRA_CRC: u8 = 78u8;
24785 const ENCODED_LEN: usize = 37usize;
24786 fn deser(
24787 _version: MavlinkVersion,
24788 __input: &[u8],
24789 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24790 let avail_len = __input.len();
24791 let mut payload_buf = [0; Self::ENCODED_LEN];
24792 let mut buf = if avail_len < Self::ENCODED_LEN {
24793 payload_buf[0..avail_len].copy_from_slice(__input);
24794 Bytes::new(&payload_buf)
24795 } else {
24796 Bytes::new(__input)
24797 };
24798 let mut __struct = Self::default();
24799 __struct.param_value0 = buf.get_f32_le();
24800 __struct.scale = buf.get_f32_le();
24801 __struct.param_value_min = buf.get_f32_le();
24802 __struct.param_value_max = buf.get_f32_le();
24803 __struct.param_index = buf.get_i16_le();
24804 __struct.target_system = buf.get_u8();
24805 __struct.target_component = buf.get_u8();
24806 let mut tmp = [0_u8; 16usize];
24807 for v in &mut tmp {
24808 *v = buf.get_u8();
24809 }
24810 __struct.param_id = CharArray::new(tmp);
24811 __struct.parameter_rc_channel_index = buf.get_u8();
24812 Ok(__struct)
24813 }
24814 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24815 let mut __tmp = BytesMut::new(bytes);
24816 #[allow(clippy::absurd_extreme_comparisons)]
24817 #[allow(unused_comparisons)]
24818 if __tmp.remaining() < Self::ENCODED_LEN {
24819 panic!(
24820 "buffer is too small (need {} bytes, but got {})",
24821 Self::ENCODED_LEN,
24822 __tmp.remaining(),
24823 )
24824 }
24825 __tmp.put_f32_le(self.param_value0);
24826 __tmp.put_f32_le(self.scale);
24827 __tmp.put_f32_le(self.param_value_min);
24828 __tmp.put_f32_le(self.param_value_max);
24829 __tmp.put_i16_le(self.param_index);
24830 __tmp.put_u8(self.target_system);
24831 __tmp.put_u8(self.target_component);
24832 for val in &self.param_id {
24833 __tmp.put_u8(*val);
24834 }
24835 __tmp.put_u8(self.parameter_rc_channel_index);
24836 if matches!(version, MavlinkVersion::V2) {
24837 let len = __tmp.len();
24838 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24839 } else {
24840 __tmp.len()
24841 }
24842 }
24843}
24844#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24845#[doc = ""]
24846#[doc = "ID: 21"]
24847#[derive(Debug, Clone, PartialEq)]
24848#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24849#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24850#[cfg_attr(feature = "ts", derive(TS))]
24851#[cfg_attr(feature = "ts", ts(export))]
24852pub struct PARAM_REQUEST_LIST_DATA {
24853 #[doc = "System ID"]
24854 pub target_system: u8,
24855 #[doc = "Component ID"]
24856 pub target_component: u8,
24857}
24858impl PARAM_REQUEST_LIST_DATA {
24859 pub const ENCODED_LEN: usize = 2usize;
24860 pub const DEFAULT: Self = Self {
24861 target_system: 0_u8,
24862 target_component: 0_u8,
24863 };
24864 #[cfg(feature = "arbitrary")]
24865 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24866 use arbitrary::{Arbitrary, Unstructured};
24867 let mut buf = [0u8; 1024];
24868 rng.fill_bytes(&mut buf);
24869 let mut unstructured = Unstructured::new(&buf);
24870 Self::arbitrary(&mut unstructured).unwrap_or_default()
24871 }
24872}
24873impl Default for PARAM_REQUEST_LIST_DATA {
24874 fn default() -> Self {
24875 Self::DEFAULT.clone()
24876 }
24877}
24878impl MessageData for PARAM_REQUEST_LIST_DATA {
24879 type Message = MavMessage;
24880 const ID: u32 = 21u32;
24881 const NAME: &'static str = "PARAM_REQUEST_LIST";
24882 const EXTRA_CRC: u8 = 159u8;
24883 const ENCODED_LEN: usize = 2usize;
24884 fn deser(
24885 _version: MavlinkVersion,
24886 __input: &[u8],
24887 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24888 let avail_len = __input.len();
24889 let mut payload_buf = [0; Self::ENCODED_LEN];
24890 let mut buf = if avail_len < Self::ENCODED_LEN {
24891 payload_buf[0..avail_len].copy_from_slice(__input);
24892 Bytes::new(&payload_buf)
24893 } else {
24894 Bytes::new(__input)
24895 };
24896 let mut __struct = Self::default();
24897 __struct.target_system = buf.get_u8();
24898 __struct.target_component = buf.get_u8();
24899 Ok(__struct)
24900 }
24901 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24902 let mut __tmp = BytesMut::new(bytes);
24903 #[allow(clippy::absurd_extreme_comparisons)]
24904 #[allow(unused_comparisons)]
24905 if __tmp.remaining() < Self::ENCODED_LEN {
24906 panic!(
24907 "buffer is too small (need {} bytes, but got {})",
24908 Self::ENCODED_LEN,
24909 __tmp.remaining(),
24910 )
24911 }
24912 __tmp.put_u8(self.target_system);
24913 __tmp.put_u8(self.target_component);
24914 if matches!(version, MavlinkVersion::V2) {
24915 let len = __tmp.len();
24916 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24917 } else {
24918 __tmp.len()
24919 }
24920 }
24921}
24922#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
24923#[doc = ""]
24924#[doc = "ID: 20"]
24925#[derive(Debug, Clone, PartialEq)]
24926#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24927#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24928#[cfg_attr(feature = "ts", derive(TS))]
24929#[cfg_attr(feature = "ts", ts(export))]
24930pub struct PARAM_REQUEST_READ_DATA {
24931 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
24932 pub param_index: i16,
24933 #[doc = "System ID"]
24934 pub target_system: u8,
24935 #[doc = "Component ID"]
24936 pub target_component: u8,
24937 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24938 #[cfg_attr(feature = "ts", ts(type = "string"))]
24939 pub param_id: CharArray<16>,
24940}
24941impl PARAM_REQUEST_READ_DATA {
24942 pub const ENCODED_LEN: usize = 20usize;
24943 pub const DEFAULT: Self = Self {
24944 param_index: 0_i16,
24945 target_system: 0_u8,
24946 target_component: 0_u8,
24947 param_id: CharArray::new([0_u8; 16usize]),
24948 };
24949 #[cfg(feature = "arbitrary")]
24950 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24951 use arbitrary::{Arbitrary, Unstructured};
24952 let mut buf = [0u8; 1024];
24953 rng.fill_bytes(&mut buf);
24954 let mut unstructured = Unstructured::new(&buf);
24955 Self::arbitrary(&mut unstructured).unwrap_or_default()
24956 }
24957}
24958impl Default for PARAM_REQUEST_READ_DATA {
24959 fn default() -> Self {
24960 Self::DEFAULT.clone()
24961 }
24962}
24963impl MessageData for PARAM_REQUEST_READ_DATA {
24964 type Message = MavMessage;
24965 const ID: u32 = 20u32;
24966 const NAME: &'static str = "PARAM_REQUEST_READ";
24967 const EXTRA_CRC: u8 = 214u8;
24968 const ENCODED_LEN: usize = 20usize;
24969 fn deser(
24970 _version: MavlinkVersion,
24971 __input: &[u8],
24972 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24973 let avail_len = __input.len();
24974 let mut payload_buf = [0; Self::ENCODED_LEN];
24975 let mut buf = if avail_len < Self::ENCODED_LEN {
24976 payload_buf[0..avail_len].copy_from_slice(__input);
24977 Bytes::new(&payload_buf)
24978 } else {
24979 Bytes::new(__input)
24980 };
24981 let mut __struct = Self::default();
24982 __struct.param_index = buf.get_i16_le();
24983 __struct.target_system = buf.get_u8();
24984 __struct.target_component = buf.get_u8();
24985 let mut tmp = [0_u8; 16usize];
24986 for v in &mut tmp {
24987 *v = buf.get_u8();
24988 }
24989 __struct.param_id = CharArray::new(tmp);
24990 Ok(__struct)
24991 }
24992 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24993 let mut __tmp = BytesMut::new(bytes);
24994 #[allow(clippy::absurd_extreme_comparisons)]
24995 #[allow(unused_comparisons)]
24996 if __tmp.remaining() < Self::ENCODED_LEN {
24997 panic!(
24998 "buffer is too small (need {} bytes, but got {})",
24999 Self::ENCODED_LEN,
25000 __tmp.remaining(),
25001 )
25002 }
25003 __tmp.put_i16_le(self.param_index);
25004 __tmp.put_u8(self.target_system);
25005 __tmp.put_u8(self.target_component);
25006 for val in &self.param_id {
25007 __tmp.put_u8(*val);
25008 }
25009 if matches!(version, MavlinkVersion::V2) {
25010 let len = __tmp.len();
25011 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25012 } else {
25013 __tmp.len()
25014 }
25015 }
25016}
25017#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
25018#[doc = ""]
25019#[doc = "ID: 23"]
25020#[derive(Debug, Clone, PartialEq)]
25021#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25022#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25023#[cfg_attr(feature = "ts", derive(TS))]
25024#[cfg_attr(feature = "ts", ts(export))]
25025pub struct PARAM_SET_DATA {
25026 #[doc = "Onboard parameter value"]
25027 pub param_value: f32,
25028 #[doc = "System ID"]
25029 pub target_system: u8,
25030 #[doc = "Component ID"]
25031 pub target_component: u8,
25032 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
25033 #[cfg_attr(feature = "ts", ts(type = "string"))]
25034 pub param_id: CharArray<16>,
25035 #[doc = "Onboard parameter type."]
25036 pub param_type: MavParamType,
25037}
25038impl PARAM_SET_DATA {
25039 pub const ENCODED_LEN: usize = 23usize;
25040 pub const DEFAULT: Self = Self {
25041 param_value: 0.0_f32,
25042 target_system: 0_u8,
25043 target_component: 0_u8,
25044 param_id: CharArray::new([0_u8; 16usize]),
25045 param_type: MavParamType::DEFAULT,
25046 };
25047 #[cfg(feature = "arbitrary")]
25048 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25049 use arbitrary::{Arbitrary, Unstructured};
25050 let mut buf = [0u8; 1024];
25051 rng.fill_bytes(&mut buf);
25052 let mut unstructured = Unstructured::new(&buf);
25053 Self::arbitrary(&mut unstructured).unwrap_or_default()
25054 }
25055}
25056impl Default for PARAM_SET_DATA {
25057 fn default() -> Self {
25058 Self::DEFAULT.clone()
25059 }
25060}
25061impl MessageData for PARAM_SET_DATA {
25062 type Message = MavMessage;
25063 const ID: u32 = 23u32;
25064 const NAME: &'static str = "PARAM_SET";
25065 const EXTRA_CRC: u8 = 168u8;
25066 const ENCODED_LEN: usize = 23usize;
25067 fn deser(
25068 _version: MavlinkVersion,
25069 __input: &[u8],
25070 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25071 let avail_len = __input.len();
25072 let mut payload_buf = [0; Self::ENCODED_LEN];
25073 let mut buf = if avail_len < Self::ENCODED_LEN {
25074 payload_buf[0..avail_len].copy_from_slice(__input);
25075 Bytes::new(&payload_buf)
25076 } else {
25077 Bytes::new(__input)
25078 };
25079 let mut __struct = Self::default();
25080 __struct.param_value = buf.get_f32_le();
25081 __struct.target_system = buf.get_u8();
25082 __struct.target_component = buf.get_u8();
25083 let mut tmp = [0_u8; 16usize];
25084 for v in &mut tmp {
25085 *v = buf.get_u8();
25086 }
25087 __struct.param_id = CharArray::new(tmp);
25088 let tmp = buf.get_u8();
25089 __struct.param_type =
25090 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25091 enum_type: "MavParamType",
25092 value: tmp as u32,
25093 })?;
25094 Ok(__struct)
25095 }
25096 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25097 let mut __tmp = BytesMut::new(bytes);
25098 #[allow(clippy::absurd_extreme_comparisons)]
25099 #[allow(unused_comparisons)]
25100 if __tmp.remaining() < Self::ENCODED_LEN {
25101 panic!(
25102 "buffer is too small (need {} bytes, but got {})",
25103 Self::ENCODED_LEN,
25104 __tmp.remaining(),
25105 )
25106 }
25107 __tmp.put_f32_le(self.param_value);
25108 __tmp.put_u8(self.target_system);
25109 __tmp.put_u8(self.target_component);
25110 for val in &self.param_id {
25111 __tmp.put_u8(*val);
25112 }
25113 __tmp.put_u8(self.param_type as u8);
25114 if matches!(version, MavlinkVersion::V2) {
25115 let len = __tmp.len();
25116 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25117 } else {
25118 __tmp.len()
25119 }
25120 }
25121}
25122#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
25123#[doc = ""]
25124#[doc = "ID: 22"]
25125#[derive(Debug, Clone, PartialEq)]
25126#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25127#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25128#[cfg_attr(feature = "ts", derive(TS))]
25129#[cfg_attr(feature = "ts", ts(export))]
25130pub struct PARAM_VALUE_DATA {
25131 #[doc = "Onboard parameter value"]
25132 pub param_value: f32,
25133 #[doc = "Total number of onboard parameters"]
25134 pub param_count: u16,
25135 #[doc = "Index of this onboard parameter"]
25136 pub param_index: u16,
25137 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
25138 #[cfg_attr(feature = "ts", ts(type = "string"))]
25139 pub param_id: CharArray<16>,
25140 #[doc = "Onboard parameter type."]
25141 pub param_type: MavParamType,
25142}
25143impl PARAM_VALUE_DATA {
25144 pub const ENCODED_LEN: usize = 25usize;
25145 pub const DEFAULT: Self = Self {
25146 param_value: 0.0_f32,
25147 param_count: 0_u16,
25148 param_index: 0_u16,
25149 param_id: CharArray::new([0_u8; 16usize]),
25150 param_type: MavParamType::DEFAULT,
25151 };
25152 #[cfg(feature = "arbitrary")]
25153 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25154 use arbitrary::{Arbitrary, Unstructured};
25155 let mut buf = [0u8; 1024];
25156 rng.fill_bytes(&mut buf);
25157 let mut unstructured = Unstructured::new(&buf);
25158 Self::arbitrary(&mut unstructured).unwrap_or_default()
25159 }
25160}
25161impl Default for PARAM_VALUE_DATA {
25162 fn default() -> Self {
25163 Self::DEFAULT.clone()
25164 }
25165}
25166impl MessageData for PARAM_VALUE_DATA {
25167 type Message = MavMessage;
25168 const ID: u32 = 22u32;
25169 const NAME: &'static str = "PARAM_VALUE";
25170 const EXTRA_CRC: u8 = 220u8;
25171 const ENCODED_LEN: usize = 25usize;
25172 fn deser(
25173 _version: MavlinkVersion,
25174 __input: &[u8],
25175 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25176 let avail_len = __input.len();
25177 let mut payload_buf = [0; Self::ENCODED_LEN];
25178 let mut buf = if avail_len < Self::ENCODED_LEN {
25179 payload_buf[0..avail_len].copy_from_slice(__input);
25180 Bytes::new(&payload_buf)
25181 } else {
25182 Bytes::new(__input)
25183 };
25184 let mut __struct = Self::default();
25185 __struct.param_value = buf.get_f32_le();
25186 __struct.param_count = buf.get_u16_le();
25187 __struct.param_index = buf.get_u16_le();
25188 let mut tmp = [0_u8; 16usize];
25189 for v in &mut tmp {
25190 *v = buf.get_u8();
25191 }
25192 __struct.param_id = CharArray::new(tmp);
25193 let tmp = buf.get_u8();
25194 __struct.param_type =
25195 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25196 enum_type: "MavParamType",
25197 value: tmp as u32,
25198 })?;
25199 Ok(__struct)
25200 }
25201 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25202 let mut __tmp = BytesMut::new(bytes);
25203 #[allow(clippy::absurd_extreme_comparisons)]
25204 #[allow(unused_comparisons)]
25205 if __tmp.remaining() < Self::ENCODED_LEN {
25206 panic!(
25207 "buffer is too small (need {} bytes, but got {})",
25208 Self::ENCODED_LEN,
25209 __tmp.remaining(),
25210 )
25211 }
25212 __tmp.put_f32_le(self.param_value);
25213 __tmp.put_u16_le(self.param_count);
25214 __tmp.put_u16_le(self.param_index);
25215 for val in &self.param_id {
25216 __tmp.put_u8(*val);
25217 }
25218 __tmp.put_u8(self.param_type as u8);
25219 if matches!(version, MavlinkVersion::V2) {
25220 let len = __tmp.len();
25221 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25222 } else {
25223 __tmp.len()
25224 }
25225 }
25226}
25227#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
25228#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
25229#[doc = ""]
25230#[doc = "ID: 4"]
25231#[derive(Debug, Clone, PartialEq)]
25232#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25233#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25234#[cfg_attr(feature = "ts", derive(TS))]
25235#[cfg_attr(feature = "ts", ts(export))]
25236pub struct PING_DATA {
25237 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25238 pub time_usec: u64,
25239 #[doc = "PING sequence"]
25240 pub seq: u32,
25241 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
25242 pub target_system: u8,
25243 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
25244 pub target_component: u8,
25245}
25246impl PING_DATA {
25247 pub const ENCODED_LEN: usize = 14usize;
25248 pub const DEFAULT: Self = Self {
25249 time_usec: 0_u64,
25250 seq: 0_u32,
25251 target_system: 0_u8,
25252 target_component: 0_u8,
25253 };
25254 #[cfg(feature = "arbitrary")]
25255 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25256 use arbitrary::{Arbitrary, Unstructured};
25257 let mut buf = [0u8; 1024];
25258 rng.fill_bytes(&mut buf);
25259 let mut unstructured = Unstructured::new(&buf);
25260 Self::arbitrary(&mut unstructured).unwrap_or_default()
25261 }
25262}
25263impl Default for PING_DATA {
25264 fn default() -> Self {
25265 Self::DEFAULT.clone()
25266 }
25267}
25268impl MessageData for PING_DATA {
25269 type Message = MavMessage;
25270 const ID: u32 = 4u32;
25271 const NAME: &'static str = "PING";
25272 const EXTRA_CRC: u8 = 237u8;
25273 const ENCODED_LEN: usize = 14usize;
25274 fn deser(
25275 _version: MavlinkVersion,
25276 __input: &[u8],
25277 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25278 let avail_len = __input.len();
25279 let mut payload_buf = [0; Self::ENCODED_LEN];
25280 let mut buf = if avail_len < Self::ENCODED_LEN {
25281 payload_buf[0..avail_len].copy_from_slice(__input);
25282 Bytes::new(&payload_buf)
25283 } else {
25284 Bytes::new(__input)
25285 };
25286 let mut __struct = Self::default();
25287 __struct.time_usec = buf.get_u64_le();
25288 __struct.seq = buf.get_u32_le();
25289 __struct.target_system = buf.get_u8();
25290 __struct.target_component = buf.get_u8();
25291 Ok(__struct)
25292 }
25293 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25294 let mut __tmp = BytesMut::new(bytes);
25295 #[allow(clippy::absurd_extreme_comparisons)]
25296 #[allow(unused_comparisons)]
25297 if __tmp.remaining() < Self::ENCODED_LEN {
25298 panic!(
25299 "buffer is too small (need {} bytes, but got {})",
25300 Self::ENCODED_LEN,
25301 __tmp.remaining(),
25302 )
25303 }
25304 __tmp.put_u64_le(self.time_usec);
25305 __tmp.put_u32_le(self.seq);
25306 __tmp.put_u8(self.target_system);
25307 __tmp.put_u8(self.target_component);
25308 if matches!(version, MavlinkVersion::V2) {
25309 let len = __tmp.len();
25310 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25311 } else {
25312 __tmp.len()
25313 }
25314 }
25315}
25316#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
25317#[doc = "Control vehicle tone generation (buzzer)."]
25318#[doc = ""]
25319#[doc = "ID: 258"]
25320#[derive(Debug, Clone, PartialEq)]
25321#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25322#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25323#[cfg_attr(feature = "ts", derive(TS))]
25324#[cfg_attr(feature = "ts", ts(export))]
25325pub struct PLAY_TUNE_DATA {
25326 #[doc = "System ID"]
25327 pub target_system: u8,
25328 #[doc = "Component ID"]
25329 pub target_component: u8,
25330 #[doc = "tune in board specific format"]
25331 #[cfg_attr(feature = "ts", ts(type = "string"))]
25332 pub tune: CharArray<30>,
25333 #[doc = "tune extension (appended to tune)"]
25334 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25335 #[cfg_attr(feature = "ts", ts(type = "string"))]
25336 pub tune2: CharArray<200>,
25337}
25338impl PLAY_TUNE_DATA {
25339 pub const ENCODED_LEN: usize = 232usize;
25340 pub const DEFAULT: Self = Self {
25341 target_system: 0_u8,
25342 target_component: 0_u8,
25343 tune: CharArray::new([0_u8; 30usize]),
25344 tune2: CharArray::new([0_u8; 200usize]),
25345 };
25346 #[cfg(feature = "arbitrary")]
25347 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25348 use arbitrary::{Arbitrary, Unstructured};
25349 let mut buf = [0u8; 1024];
25350 rng.fill_bytes(&mut buf);
25351 let mut unstructured = Unstructured::new(&buf);
25352 Self::arbitrary(&mut unstructured).unwrap_or_default()
25353 }
25354}
25355impl Default for PLAY_TUNE_DATA {
25356 fn default() -> Self {
25357 Self::DEFAULT.clone()
25358 }
25359}
25360impl MessageData for PLAY_TUNE_DATA {
25361 type Message = MavMessage;
25362 const ID: u32 = 258u32;
25363 const NAME: &'static str = "PLAY_TUNE";
25364 const EXTRA_CRC: u8 = 187u8;
25365 const ENCODED_LEN: usize = 232usize;
25366 fn deser(
25367 _version: MavlinkVersion,
25368 __input: &[u8],
25369 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25370 let avail_len = __input.len();
25371 let mut payload_buf = [0; Self::ENCODED_LEN];
25372 let mut buf = if avail_len < Self::ENCODED_LEN {
25373 payload_buf[0..avail_len].copy_from_slice(__input);
25374 Bytes::new(&payload_buf)
25375 } else {
25376 Bytes::new(__input)
25377 };
25378 let mut __struct = Self::default();
25379 __struct.target_system = buf.get_u8();
25380 __struct.target_component = buf.get_u8();
25381 let mut tmp = [0_u8; 30usize];
25382 for v in &mut tmp {
25383 *v = buf.get_u8();
25384 }
25385 __struct.tune = CharArray::new(tmp);
25386 let mut tmp = [0_u8; 200usize];
25387 for v in &mut tmp {
25388 *v = buf.get_u8();
25389 }
25390 __struct.tune2 = CharArray::new(tmp);
25391 Ok(__struct)
25392 }
25393 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25394 let mut __tmp = BytesMut::new(bytes);
25395 #[allow(clippy::absurd_extreme_comparisons)]
25396 #[allow(unused_comparisons)]
25397 if __tmp.remaining() < Self::ENCODED_LEN {
25398 panic!(
25399 "buffer is too small (need {} bytes, but got {})",
25400 Self::ENCODED_LEN,
25401 __tmp.remaining(),
25402 )
25403 }
25404 __tmp.put_u8(self.target_system);
25405 __tmp.put_u8(self.target_component);
25406 for val in &self.tune {
25407 __tmp.put_u8(*val);
25408 }
25409 if matches!(version, MavlinkVersion::V2) {
25410 for val in &self.tune2 {
25411 __tmp.put_u8(*val);
25412 }
25413 let len = __tmp.len();
25414 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25415 } else {
25416 __tmp.len()
25417 }
25418 }
25419}
25420#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
25421#[doc = ""]
25422#[doc = "ID: 400"]
25423#[derive(Debug, Clone, PartialEq)]
25424#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25425#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25426#[cfg_attr(feature = "ts", derive(TS))]
25427#[cfg_attr(feature = "ts", ts(export))]
25428pub struct PLAY_TUNE_V2_DATA {
25429 #[doc = "Tune format"]
25430 pub format: TuneFormat,
25431 #[doc = "System ID"]
25432 pub target_system: u8,
25433 #[doc = "Component ID"]
25434 pub target_component: u8,
25435 #[doc = "Tune definition as a NULL-terminated string."]
25436 #[cfg_attr(feature = "ts", ts(type = "string"))]
25437 pub tune: CharArray<248>,
25438}
25439impl PLAY_TUNE_V2_DATA {
25440 pub const ENCODED_LEN: usize = 254usize;
25441 pub const DEFAULT: Self = Self {
25442 format: TuneFormat::DEFAULT,
25443 target_system: 0_u8,
25444 target_component: 0_u8,
25445 tune: CharArray::new([0_u8; 248usize]),
25446 };
25447 #[cfg(feature = "arbitrary")]
25448 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25449 use arbitrary::{Arbitrary, Unstructured};
25450 let mut buf = [0u8; 1024];
25451 rng.fill_bytes(&mut buf);
25452 let mut unstructured = Unstructured::new(&buf);
25453 Self::arbitrary(&mut unstructured).unwrap_or_default()
25454 }
25455}
25456impl Default for PLAY_TUNE_V2_DATA {
25457 fn default() -> Self {
25458 Self::DEFAULT.clone()
25459 }
25460}
25461impl MessageData for PLAY_TUNE_V2_DATA {
25462 type Message = MavMessage;
25463 const ID: u32 = 400u32;
25464 const NAME: &'static str = "PLAY_TUNE_V2";
25465 const EXTRA_CRC: u8 = 110u8;
25466 const ENCODED_LEN: usize = 254usize;
25467 fn deser(
25468 _version: MavlinkVersion,
25469 __input: &[u8],
25470 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25471 let avail_len = __input.len();
25472 let mut payload_buf = [0; Self::ENCODED_LEN];
25473 let mut buf = if avail_len < Self::ENCODED_LEN {
25474 payload_buf[0..avail_len].copy_from_slice(__input);
25475 Bytes::new(&payload_buf)
25476 } else {
25477 Bytes::new(__input)
25478 };
25479 let mut __struct = Self::default();
25480 let tmp = buf.get_u32_le();
25481 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
25482 ::mavlink_core::error::ParserError::InvalidEnum {
25483 enum_type: "TuneFormat",
25484 value: tmp as u32,
25485 },
25486 )?;
25487 __struct.target_system = buf.get_u8();
25488 __struct.target_component = buf.get_u8();
25489 let mut tmp = [0_u8; 248usize];
25490 for v in &mut tmp {
25491 *v = buf.get_u8();
25492 }
25493 __struct.tune = CharArray::new(tmp);
25494 Ok(__struct)
25495 }
25496 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25497 let mut __tmp = BytesMut::new(bytes);
25498 #[allow(clippy::absurd_extreme_comparisons)]
25499 #[allow(unused_comparisons)]
25500 if __tmp.remaining() < Self::ENCODED_LEN {
25501 panic!(
25502 "buffer is too small (need {} bytes, but got {})",
25503 Self::ENCODED_LEN,
25504 __tmp.remaining(),
25505 )
25506 }
25507 __tmp.put_u32_le(self.format as u32);
25508 __tmp.put_u8(self.target_system);
25509 __tmp.put_u8(self.target_component);
25510 for val in &self.tune {
25511 __tmp.put_u8(*val);
25512 }
25513 if matches!(version, MavlinkVersion::V2) {
25514 let len = __tmp.len();
25515 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25516 } else {
25517 __tmp.len()
25518 }
25519 }
25520}
25521#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
25522#[doc = ""]
25523#[doc = "ID: 87"]
25524#[derive(Debug, Clone, PartialEq)]
25525#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25526#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25527#[cfg_attr(feature = "ts", derive(TS))]
25528#[cfg_attr(feature = "ts", ts(export))]
25529pub struct POSITION_TARGET_GLOBAL_INT_DATA {
25530 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
25531 pub time_boot_ms: u32,
25532 #[doc = "Latitude in WGS84 frame"]
25533 pub lat_int: i32,
25534 #[doc = "Longitude in WGS84 frame"]
25535 pub lon_int: i32,
25536 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
25537 pub alt: f32,
25538 #[doc = "X velocity in NED frame"]
25539 pub vx: f32,
25540 #[doc = "Y velocity in NED frame"]
25541 pub vy: f32,
25542 #[doc = "Z velocity in NED frame"]
25543 pub vz: f32,
25544 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25545 pub afx: f32,
25546 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25547 pub afy: f32,
25548 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25549 pub afz: f32,
25550 #[doc = "yaw setpoint"]
25551 pub yaw: f32,
25552 #[doc = "yaw rate setpoint"]
25553 pub yaw_rate: f32,
25554 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
25555 pub type_mask: PositionTargetTypemask,
25556 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
25557 pub coordinate_frame: MavFrame,
25558}
25559impl POSITION_TARGET_GLOBAL_INT_DATA {
25560 pub const ENCODED_LEN: usize = 51usize;
25561 pub const DEFAULT: Self = Self {
25562 time_boot_ms: 0_u32,
25563 lat_int: 0_i32,
25564 lon_int: 0_i32,
25565 alt: 0.0_f32,
25566 vx: 0.0_f32,
25567 vy: 0.0_f32,
25568 vz: 0.0_f32,
25569 afx: 0.0_f32,
25570 afy: 0.0_f32,
25571 afz: 0.0_f32,
25572 yaw: 0.0_f32,
25573 yaw_rate: 0.0_f32,
25574 type_mask: PositionTargetTypemask::DEFAULT,
25575 coordinate_frame: MavFrame::DEFAULT,
25576 };
25577 #[cfg(feature = "arbitrary")]
25578 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25579 use arbitrary::{Arbitrary, Unstructured};
25580 let mut buf = [0u8; 1024];
25581 rng.fill_bytes(&mut buf);
25582 let mut unstructured = Unstructured::new(&buf);
25583 Self::arbitrary(&mut unstructured).unwrap_or_default()
25584 }
25585}
25586impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
25587 fn default() -> Self {
25588 Self::DEFAULT.clone()
25589 }
25590}
25591impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
25592 type Message = MavMessage;
25593 const ID: u32 = 87u32;
25594 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
25595 const EXTRA_CRC: u8 = 150u8;
25596 const ENCODED_LEN: usize = 51usize;
25597 fn deser(
25598 _version: MavlinkVersion,
25599 __input: &[u8],
25600 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25601 let avail_len = __input.len();
25602 let mut payload_buf = [0; Self::ENCODED_LEN];
25603 let mut buf = if avail_len < Self::ENCODED_LEN {
25604 payload_buf[0..avail_len].copy_from_slice(__input);
25605 Bytes::new(&payload_buf)
25606 } else {
25607 Bytes::new(__input)
25608 };
25609 let mut __struct = Self::default();
25610 __struct.time_boot_ms = buf.get_u32_le();
25611 __struct.lat_int = buf.get_i32_le();
25612 __struct.lon_int = buf.get_i32_le();
25613 __struct.alt = buf.get_f32_le();
25614 __struct.vx = buf.get_f32_le();
25615 __struct.vy = buf.get_f32_le();
25616 __struct.vz = buf.get_f32_le();
25617 __struct.afx = buf.get_f32_le();
25618 __struct.afy = buf.get_f32_le();
25619 __struct.afz = buf.get_f32_le();
25620 __struct.yaw = buf.get_f32_le();
25621 __struct.yaw_rate = buf.get_f32_le();
25622 let tmp = buf.get_u16_le();
25623 __struct.type_mask = PositionTargetTypemask::from_bits(
25624 tmp & PositionTargetTypemask::all().bits(),
25625 )
25626 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
25627 flag_type: "PositionTargetTypemask",
25628 value: tmp as u32,
25629 })?;
25630 let tmp = buf.get_u8();
25631 __struct.coordinate_frame =
25632 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25633 enum_type: "MavFrame",
25634 value: tmp as u32,
25635 })?;
25636 Ok(__struct)
25637 }
25638 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25639 let mut __tmp = BytesMut::new(bytes);
25640 #[allow(clippy::absurd_extreme_comparisons)]
25641 #[allow(unused_comparisons)]
25642 if __tmp.remaining() < Self::ENCODED_LEN {
25643 panic!(
25644 "buffer is too small (need {} bytes, but got {})",
25645 Self::ENCODED_LEN,
25646 __tmp.remaining(),
25647 )
25648 }
25649 __tmp.put_u32_le(self.time_boot_ms);
25650 __tmp.put_i32_le(self.lat_int);
25651 __tmp.put_i32_le(self.lon_int);
25652 __tmp.put_f32_le(self.alt);
25653 __tmp.put_f32_le(self.vx);
25654 __tmp.put_f32_le(self.vy);
25655 __tmp.put_f32_le(self.vz);
25656 __tmp.put_f32_le(self.afx);
25657 __tmp.put_f32_le(self.afy);
25658 __tmp.put_f32_le(self.afz);
25659 __tmp.put_f32_le(self.yaw);
25660 __tmp.put_f32_le(self.yaw_rate);
25661 __tmp.put_u16_le(self.type_mask.bits());
25662 __tmp.put_u8(self.coordinate_frame as u8);
25663 if matches!(version, MavlinkVersion::V2) {
25664 let len = __tmp.len();
25665 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25666 } else {
25667 __tmp.len()
25668 }
25669 }
25670}
25671#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
25672#[doc = ""]
25673#[doc = "ID: 85"]
25674#[derive(Debug, Clone, PartialEq)]
25675#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25676#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25677#[cfg_attr(feature = "ts", derive(TS))]
25678#[cfg_attr(feature = "ts", ts(export))]
25679pub struct POSITION_TARGET_LOCAL_NED_DATA {
25680 #[doc = "Timestamp (time since system boot)."]
25681 pub time_boot_ms: u32,
25682 #[doc = "X Position in NED frame"]
25683 pub x: f32,
25684 #[doc = "Y Position in NED frame"]
25685 pub y: f32,
25686 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
25687 pub z: f32,
25688 #[doc = "X velocity in NED frame"]
25689 pub vx: f32,
25690 #[doc = "Y velocity in NED frame"]
25691 pub vy: f32,
25692 #[doc = "Z velocity in NED frame"]
25693 pub vz: f32,
25694 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25695 pub afx: f32,
25696 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25697 pub afy: f32,
25698 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25699 pub afz: f32,
25700 #[doc = "yaw setpoint"]
25701 pub yaw: f32,
25702 #[doc = "yaw rate setpoint"]
25703 pub yaw_rate: f32,
25704 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
25705 pub type_mask: PositionTargetTypemask,
25706 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
25707 pub coordinate_frame: MavFrame,
25708}
25709impl POSITION_TARGET_LOCAL_NED_DATA {
25710 pub const ENCODED_LEN: usize = 51usize;
25711 pub const DEFAULT: Self = Self {
25712 time_boot_ms: 0_u32,
25713 x: 0.0_f32,
25714 y: 0.0_f32,
25715 z: 0.0_f32,
25716 vx: 0.0_f32,
25717 vy: 0.0_f32,
25718 vz: 0.0_f32,
25719 afx: 0.0_f32,
25720 afy: 0.0_f32,
25721 afz: 0.0_f32,
25722 yaw: 0.0_f32,
25723 yaw_rate: 0.0_f32,
25724 type_mask: PositionTargetTypemask::DEFAULT,
25725 coordinate_frame: MavFrame::DEFAULT,
25726 };
25727 #[cfg(feature = "arbitrary")]
25728 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25729 use arbitrary::{Arbitrary, Unstructured};
25730 let mut buf = [0u8; 1024];
25731 rng.fill_bytes(&mut buf);
25732 let mut unstructured = Unstructured::new(&buf);
25733 Self::arbitrary(&mut unstructured).unwrap_or_default()
25734 }
25735}
25736impl Default for POSITION_TARGET_LOCAL_NED_DATA {
25737 fn default() -> Self {
25738 Self::DEFAULT.clone()
25739 }
25740}
25741impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
25742 type Message = MavMessage;
25743 const ID: u32 = 85u32;
25744 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
25745 const EXTRA_CRC: u8 = 140u8;
25746 const ENCODED_LEN: usize = 51usize;
25747 fn deser(
25748 _version: MavlinkVersion,
25749 __input: &[u8],
25750 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25751 let avail_len = __input.len();
25752 let mut payload_buf = [0; Self::ENCODED_LEN];
25753 let mut buf = if avail_len < Self::ENCODED_LEN {
25754 payload_buf[0..avail_len].copy_from_slice(__input);
25755 Bytes::new(&payload_buf)
25756 } else {
25757 Bytes::new(__input)
25758 };
25759 let mut __struct = Self::default();
25760 __struct.time_boot_ms = buf.get_u32_le();
25761 __struct.x = buf.get_f32_le();
25762 __struct.y = buf.get_f32_le();
25763 __struct.z = buf.get_f32_le();
25764 __struct.vx = buf.get_f32_le();
25765 __struct.vy = buf.get_f32_le();
25766 __struct.vz = buf.get_f32_le();
25767 __struct.afx = buf.get_f32_le();
25768 __struct.afy = buf.get_f32_le();
25769 __struct.afz = buf.get_f32_le();
25770 __struct.yaw = buf.get_f32_le();
25771 __struct.yaw_rate = buf.get_f32_le();
25772 let tmp = buf.get_u16_le();
25773 __struct.type_mask = PositionTargetTypemask::from_bits(
25774 tmp & PositionTargetTypemask::all().bits(),
25775 )
25776 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
25777 flag_type: "PositionTargetTypemask",
25778 value: tmp as u32,
25779 })?;
25780 let tmp = buf.get_u8();
25781 __struct.coordinate_frame =
25782 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25783 enum_type: "MavFrame",
25784 value: tmp as u32,
25785 })?;
25786 Ok(__struct)
25787 }
25788 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25789 let mut __tmp = BytesMut::new(bytes);
25790 #[allow(clippy::absurd_extreme_comparisons)]
25791 #[allow(unused_comparisons)]
25792 if __tmp.remaining() < Self::ENCODED_LEN {
25793 panic!(
25794 "buffer is too small (need {} bytes, but got {})",
25795 Self::ENCODED_LEN,
25796 __tmp.remaining(),
25797 )
25798 }
25799 __tmp.put_u32_le(self.time_boot_ms);
25800 __tmp.put_f32_le(self.x);
25801 __tmp.put_f32_le(self.y);
25802 __tmp.put_f32_le(self.z);
25803 __tmp.put_f32_le(self.vx);
25804 __tmp.put_f32_le(self.vy);
25805 __tmp.put_f32_le(self.vz);
25806 __tmp.put_f32_le(self.afx);
25807 __tmp.put_f32_le(self.afy);
25808 __tmp.put_f32_le(self.afz);
25809 __tmp.put_f32_le(self.yaw);
25810 __tmp.put_f32_le(self.yaw_rate);
25811 __tmp.put_u16_le(self.type_mask.bits());
25812 __tmp.put_u8(self.coordinate_frame as u8);
25813 if matches!(version, MavlinkVersion::V2) {
25814 let len = __tmp.len();
25815 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25816 } else {
25817 __tmp.len()
25818 }
25819 }
25820}
25821#[doc = "Power supply status."]
25822#[doc = ""]
25823#[doc = "ID: 125"]
25824#[derive(Debug, Clone, PartialEq)]
25825#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25826#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25827#[cfg_attr(feature = "ts", derive(TS))]
25828#[cfg_attr(feature = "ts", ts(export))]
25829pub struct POWER_STATUS_DATA {
25830 #[doc = "5V rail voltage."]
25831 pub Vcc: u16,
25832 #[doc = "Servo rail voltage."]
25833 pub Vservo: u16,
25834 #[doc = "Bitmap of power supply status flags."]
25835 pub flags: MavPowerStatus,
25836}
25837impl POWER_STATUS_DATA {
25838 pub const ENCODED_LEN: usize = 6usize;
25839 pub const DEFAULT: Self = Self {
25840 Vcc: 0_u16,
25841 Vservo: 0_u16,
25842 flags: MavPowerStatus::DEFAULT,
25843 };
25844 #[cfg(feature = "arbitrary")]
25845 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25846 use arbitrary::{Arbitrary, Unstructured};
25847 let mut buf = [0u8; 1024];
25848 rng.fill_bytes(&mut buf);
25849 let mut unstructured = Unstructured::new(&buf);
25850 Self::arbitrary(&mut unstructured).unwrap_or_default()
25851 }
25852}
25853impl Default for POWER_STATUS_DATA {
25854 fn default() -> Self {
25855 Self::DEFAULT.clone()
25856 }
25857}
25858impl MessageData for POWER_STATUS_DATA {
25859 type Message = MavMessage;
25860 const ID: u32 = 125u32;
25861 const NAME: &'static str = "POWER_STATUS";
25862 const EXTRA_CRC: u8 = 203u8;
25863 const ENCODED_LEN: usize = 6usize;
25864 fn deser(
25865 _version: MavlinkVersion,
25866 __input: &[u8],
25867 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25868 let avail_len = __input.len();
25869 let mut payload_buf = [0; Self::ENCODED_LEN];
25870 let mut buf = if avail_len < Self::ENCODED_LEN {
25871 payload_buf[0..avail_len].copy_from_slice(__input);
25872 Bytes::new(&payload_buf)
25873 } else {
25874 Bytes::new(__input)
25875 };
25876 let mut __struct = Self::default();
25877 __struct.Vcc = buf.get_u16_le();
25878 __struct.Vservo = buf.get_u16_le();
25879 let tmp = buf.get_u16_le();
25880 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
25881 ::mavlink_core::error::ParserError::InvalidFlag {
25882 flag_type: "MavPowerStatus",
25883 value: tmp as u32,
25884 },
25885 )?;
25886 Ok(__struct)
25887 }
25888 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25889 let mut __tmp = BytesMut::new(bytes);
25890 #[allow(clippy::absurd_extreme_comparisons)]
25891 #[allow(unused_comparisons)]
25892 if __tmp.remaining() < Self::ENCODED_LEN {
25893 panic!(
25894 "buffer is too small (need {} bytes, but got {})",
25895 Self::ENCODED_LEN,
25896 __tmp.remaining(),
25897 )
25898 }
25899 __tmp.put_u16_le(self.Vcc);
25900 __tmp.put_u16_le(self.Vservo);
25901 __tmp.put_u16_le(self.flags.bits());
25902 if matches!(version, MavlinkVersion::V2) {
25903 let len = __tmp.len();
25904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25905 } else {
25906 __tmp.len()
25907 }
25908 }
25909}
25910#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
25911#[doc = ""]
25912#[doc = "ID: 300"]
25913#[derive(Debug, Clone, PartialEq)]
25914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25916#[cfg_attr(feature = "ts", derive(TS))]
25917#[cfg_attr(feature = "ts", ts(export))]
25918pub struct PROTOCOL_VERSION_DATA {
25919 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
25920 pub version: u16,
25921 #[doc = "Minimum MAVLink version supported"]
25922 pub min_version: u16,
25923 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
25924 pub max_version: u16,
25925 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25926 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25927 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25928 pub spec_version_hash: [u8; 8],
25929 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25930 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25931 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25932 pub library_version_hash: [u8; 8],
25933}
25934impl PROTOCOL_VERSION_DATA {
25935 pub const ENCODED_LEN: usize = 22usize;
25936 pub const DEFAULT: Self = Self {
25937 version: 0_u16,
25938 min_version: 0_u16,
25939 max_version: 0_u16,
25940 spec_version_hash: [0_u8; 8usize],
25941 library_version_hash: [0_u8; 8usize],
25942 };
25943 #[cfg(feature = "arbitrary")]
25944 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25945 use arbitrary::{Arbitrary, Unstructured};
25946 let mut buf = [0u8; 1024];
25947 rng.fill_bytes(&mut buf);
25948 let mut unstructured = Unstructured::new(&buf);
25949 Self::arbitrary(&mut unstructured).unwrap_or_default()
25950 }
25951}
25952impl Default for PROTOCOL_VERSION_DATA {
25953 fn default() -> Self {
25954 Self::DEFAULT.clone()
25955 }
25956}
25957impl MessageData for PROTOCOL_VERSION_DATA {
25958 type Message = MavMessage;
25959 const ID: u32 = 300u32;
25960 const NAME: &'static str = "PROTOCOL_VERSION";
25961 const EXTRA_CRC: u8 = 217u8;
25962 const ENCODED_LEN: usize = 22usize;
25963 fn deser(
25964 _version: MavlinkVersion,
25965 __input: &[u8],
25966 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25967 let avail_len = __input.len();
25968 let mut payload_buf = [0; Self::ENCODED_LEN];
25969 let mut buf = if avail_len < Self::ENCODED_LEN {
25970 payload_buf[0..avail_len].copy_from_slice(__input);
25971 Bytes::new(&payload_buf)
25972 } else {
25973 Bytes::new(__input)
25974 };
25975 let mut __struct = Self::default();
25976 __struct.version = buf.get_u16_le();
25977 __struct.min_version = buf.get_u16_le();
25978 __struct.max_version = buf.get_u16_le();
25979 for v in &mut __struct.spec_version_hash {
25980 let val = buf.get_u8();
25981 *v = val;
25982 }
25983 for v in &mut __struct.library_version_hash {
25984 let val = buf.get_u8();
25985 *v = val;
25986 }
25987 Ok(__struct)
25988 }
25989 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25990 let mut __tmp = BytesMut::new(bytes);
25991 #[allow(clippy::absurd_extreme_comparisons)]
25992 #[allow(unused_comparisons)]
25993 if __tmp.remaining() < Self::ENCODED_LEN {
25994 panic!(
25995 "buffer is too small (need {} bytes, but got {})",
25996 Self::ENCODED_LEN,
25997 __tmp.remaining(),
25998 )
25999 }
26000 __tmp.put_u16_le(self.version);
26001 __tmp.put_u16_le(self.min_version);
26002 __tmp.put_u16_le(self.max_version);
26003 for val in &self.spec_version_hash {
26004 __tmp.put_u8(*val);
26005 }
26006 for val in &self.library_version_hash {
26007 __tmp.put_u8(*val);
26008 }
26009 if matches!(version, MavlinkVersion::V2) {
26010 let len = __tmp.len();
26011 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26012 } else {
26013 __tmp.len()
26014 }
26015 }
26016}
26017#[doc = "Status generated by radio and injected into MAVLink stream."]
26018#[doc = ""]
26019#[doc = "ID: 109"]
26020#[derive(Debug, Clone, PartialEq)]
26021#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26022#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26023#[cfg_attr(feature = "ts", derive(TS))]
26024#[cfg_attr(feature = "ts", ts(export))]
26025pub struct RADIO_STATUS_DATA {
26026 #[doc = "Count of radio packet receive errors (since boot)."]
26027 pub rxerrors: u16,
26028 #[doc = "Count of error corrected radio packets (since boot)."]
26029 pub fixed: u16,
26030 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26031 pub rssi: u8,
26032 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26033 pub remrssi: u8,
26034 #[doc = "Remaining free transmitter buffer space."]
26035 pub txbuf: u8,
26036 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
26037 pub noise: u8,
26038 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
26039 pub remnoise: u8,
26040}
26041impl RADIO_STATUS_DATA {
26042 pub const ENCODED_LEN: usize = 9usize;
26043 pub const DEFAULT: Self = Self {
26044 rxerrors: 0_u16,
26045 fixed: 0_u16,
26046 rssi: 0_u8,
26047 remrssi: 0_u8,
26048 txbuf: 0_u8,
26049 noise: 0_u8,
26050 remnoise: 0_u8,
26051 };
26052 #[cfg(feature = "arbitrary")]
26053 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26054 use arbitrary::{Arbitrary, Unstructured};
26055 let mut buf = [0u8; 1024];
26056 rng.fill_bytes(&mut buf);
26057 let mut unstructured = Unstructured::new(&buf);
26058 Self::arbitrary(&mut unstructured).unwrap_or_default()
26059 }
26060}
26061impl Default for RADIO_STATUS_DATA {
26062 fn default() -> Self {
26063 Self::DEFAULT.clone()
26064 }
26065}
26066impl MessageData for RADIO_STATUS_DATA {
26067 type Message = MavMessage;
26068 const ID: u32 = 109u32;
26069 const NAME: &'static str = "RADIO_STATUS";
26070 const EXTRA_CRC: u8 = 185u8;
26071 const ENCODED_LEN: usize = 9usize;
26072 fn deser(
26073 _version: MavlinkVersion,
26074 __input: &[u8],
26075 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26076 let avail_len = __input.len();
26077 let mut payload_buf = [0; Self::ENCODED_LEN];
26078 let mut buf = if avail_len < Self::ENCODED_LEN {
26079 payload_buf[0..avail_len].copy_from_slice(__input);
26080 Bytes::new(&payload_buf)
26081 } else {
26082 Bytes::new(__input)
26083 };
26084 let mut __struct = Self::default();
26085 __struct.rxerrors = buf.get_u16_le();
26086 __struct.fixed = buf.get_u16_le();
26087 __struct.rssi = buf.get_u8();
26088 __struct.remrssi = buf.get_u8();
26089 __struct.txbuf = buf.get_u8();
26090 __struct.noise = buf.get_u8();
26091 __struct.remnoise = buf.get_u8();
26092 Ok(__struct)
26093 }
26094 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26095 let mut __tmp = BytesMut::new(bytes);
26096 #[allow(clippy::absurd_extreme_comparisons)]
26097 #[allow(unused_comparisons)]
26098 if __tmp.remaining() < Self::ENCODED_LEN {
26099 panic!(
26100 "buffer is too small (need {} bytes, but got {})",
26101 Self::ENCODED_LEN,
26102 __tmp.remaining(),
26103 )
26104 }
26105 __tmp.put_u16_le(self.rxerrors);
26106 __tmp.put_u16_le(self.fixed);
26107 __tmp.put_u8(self.rssi);
26108 __tmp.put_u8(self.remrssi);
26109 __tmp.put_u8(self.txbuf);
26110 __tmp.put_u8(self.noise);
26111 __tmp.put_u8(self.remnoise);
26112 if matches!(version, MavlinkVersion::V2) {
26113 let len = __tmp.len();
26114 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26115 } else {
26116 __tmp.len()
26117 }
26118 }
26119}
26120#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
26121#[doc = ""]
26122#[doc = "ID: 27"]
26123#[derive(Debug, Clone, PartialEq)]
26124#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26125#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26126#[cfg_attr(feature = "ts", derive(TS))]
26127#[cfg_attr(feature = "ts", ts(export))]
26128pub struct RAW_IMU_DATA {
26129 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26130 pub time_usec: u64,
26131 #[doc = "X acceleration (raw)"]
26132 pub xacc: i16,
26133 #[doc = "Y acceleration (raw)"]
26134 pub yacc: i16,
26135 #[doc = "Z acceleration (raw)"]
26136 pub zacc: i16,
26137 #[doc = "Angular speed around X axis (raw)"]
26138 pub xgyro: i16,
26139 #[doc = "Angular speed around Y axis (raw)"]
26140 pub ygyro: i16,
26141 #[doc = "Angular speed around Z axis (raw)"]
26142 pub zgyro: i16,
26143 #[doc = "X Magnetic field (raw)"]
26144 pub xmag: i16,
26145 #[doc = "Y Magnetic field (raw)"]
26146 pub ymag: i16,
26147 #[doc = "Z Magnetic field (raw)"]
26148 pub zmag: i16,
26149 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
26150 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26151 pub id: u8,
26152 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26153 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26154 pub temperature: i16,
26155}
26156impl RAW_IMU_DATA {
26157 pub const ENCODED_LEN: usize = 29usize;
26158 pub const DEFAULT: Self = Self {
26159 time_usec: 0_u64,
26160 xacc: 0_i16,
26161 yacc: 0_i16,
26162 zacc: 0_i16,
26163 xgyro: 0_i16,
26164 ygyro: 0_i16,
26165 zgyro: 0_i16,
26166 xmag: 0_i16,
26167 ymag: 0_i16,
26168 zmag: 0_i16,
26169 id: 0_u8,
26170 temperature: 0_i16,
26171 };
26172 #[cfg(feature = "arbitrary")]
26173 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26174 use arbitrary::{Arbitrary, Unstructured};
26175 let mut buf = [0u8; 1024];
26176 rng.fill_bytes(&mut buf);
26177 let mut unstructured = Unstructured::new(&buf);
26178 Self::arbitrary(&mut unstructured).unwrap_or_default()
26179 }
26180}
26181impl Default for RAW_IMU_DATA {
26182 fn default() -> Self {
26183 Self::DEFAULT.clone()
26184 }
26185}
26186impl MessageData for RAW_IMU_DATA {
26187 type Message = MavMessage;
26188 const ID: u32 = 27u32;
26189 const NAME: &'static str = "RAW_IMU";
26190 const EXTRA_CRC: u8 = 144u8;
26191 const ENCODED_LEN: usize = 29usize;
26192 fn deser(
26193 _version: MavlinkVersion,
26194 __input: &[u8],
26195 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26196 let avail_len = __input.len();
26197 let mut payload_buf = [0; Self::ENCODED_LEN];
26198 let mut buf = if avail_len < Self::ENCODED_LEN {
26199 payload_buf[0..avail_len].copy_from_slice(__input);
26200 Bytes::new(&payload_buf)
26201 } else {
26202 Bytes::new(__input)
26203 };
26204 let mut __struct = Self::default();
26205 __struct.time_usec = buf.get_u64_le();
26206 __struct.xacc = buf.get_i16_le();
26207 __struct.yacc = buf.get_i16_le();
26208 __struct.zacc = buf.get_i16_le();
26209 __struct.xgyro = buf.get_i16_le();
26210 __struct.ygyro = buf.get_i16_le();
26211 __struct.zgyro = buf.get_i16_le();
26212 __struct.xmag = buf.get_i16_le();
26213 __struct.ymag = buf.get_i16_le();
26214 __struct.zmag = buf.get_i16_le();
26215 __struct.id = buf.get_u8();
26216 __struct.temperature = buf.get_i16_le();
26217 Ok(__struct)
26218 }
26219 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26220 let mut __tmp = BytesMut::new(bytes);
26221 #[allow(clippy::absurd_extreme_comparisons)]
26222 #[allow(unused_comparisons)]
26223 if __tmp.remaining() < Self::ENCODED_LEN {
26224 panic!(
26225 "buffer is too small (need {} bytes, but got {})",
26226 Self::ENCODED_LEN,
26227 __tmp.remaining(),
26228 )
26229 }
26230 __tmp.put_u64_le(self.time_usec);
26231 __tmp.put_i16_le(self.xacc);
26232 __tmp.put_i16_le(self.yacc);
26233 __tmp.put_i16_le(self.zacc);
26234 __tmp.put_i16_le(self.xgyro);
26235 __tmp.put_i16_le(self.ygyro);
26236 __tmp.put_i16_le(self.zgyro);
26237 __tmp.put_i16_le(self.xmag);
26238 __tmp.put_i16_le(self.ymag);
26239 __tmp.put_i16_le(self.zmag);
26240 if matches!(version, MavlinkVersion::V2) {
26241 __tmp.put_u8(self.id);
26242 __tmp.put_i16_le(self.temperature);
26243 let len = __tmp.len();
26244 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26245 } else {
26246 __tmp.len()
26247 }
26248 }
26249}
26250#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
26251#[doc = ""]
26252#[doc = "ID: 28"]
26253#[derive(Debug, Clone, PartialEq)]
26254#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26256#[cfg_attr(feature = "ts", derive(TS))]
26257#[cfg_attr(feature = "ts", ts(export))]
26258pub struct RAW_PRESSURE_DATA {
26259 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26260 pub time_usec: u64,
26261 #[doc = "Absolute pressure (raw)"]
26262 pub press_abs: i16,
26263 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
26264 pub press_diff1: i16,
26265 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
26266 pub press_diff2: i16,
26267 #[doc = "Raw Temperature measurement (raw)"]
26268 pub temperature: i16,
26269}
26270impl RAW_PRESSURE_DATA {
26271 pub const ENCODED_LEN: usize = 16usize;
26272 pub const DEFAULT: Self = Self {
26273 time_usec: 0_u64,
26274 press_abs: 0_i16,
26275 press_diff1: 0_i16,
26276 press_diff2: 0_i16,
26277 temperature: 0_i16,
26278 };
26279 #[cfg(feature = "arbitrary")]
26280 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26281 use arbitrary::{Arbitrary, Unstructured};
26282 let mut buf = [0u8; 1024];
26283 rng.fill_bytes(&mut buf);
26284 let mut unstructured = Unstructured::new(&buf);
26285 Self::arbitrary(&mut unstructured).unwrap_or_default()
26286 }
26287}
26288impl Default for RAW_PRESSURE_DATA {
26289 fn default() -> Self {
26290 Self::DEFAULT.clone()
26291 }
26292}
26293impl MessageData for RAW_PRESSURE_DATA {
26294 type Message = MavMessage;
26295 const ID: u32 = 28u32;
26296 const NAME: &'static str = "RAW_PRESSURE";
26297 const EXTRA_CRC: u8 = 67u8;
26298 const ENCODED_LEN: usize = 16usize;
26299 fn deser(
26300 _version: MavlinkVersion,
26301 __input: &[u8],
26302 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26303 let avail_len = __input.len();
26304 let mut payload_buf = [0; Self::ENCODED_LEN];
26305 let mut buf = if avail_len < Self::ENCODED_LEN {
26306 payload_buf[0..avail_len].copy_from_slice(__input);
26307 Bytes::new(&payload_buf)
26308 } else {
26309 Bytes::new(__input)
26310 };
26311 let mut __struct = Self::default();
26312 __struct.time_usec = buf.get_u64_le();
26313 __struct.press_abs = buf.get_i16_le();
26314 __struct.press_diff1 = buf.get_i16_le();
26315 __struct.press_diff2 = buf.get_i16_le();
26316 __struct.temperature = buf.get_i16_le();
26317 Ok(__struct)
26318 }
26319 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26320 let mut __tmp = BytesMut::new(bytes);
26321 #[allow(clippy::absurd_extreme_comparisons)]
26322 #[allow(unused_comparisons)]
26323 if __tmp.remaining() < Self::ENCODED_LEN {
26324 panic!(
26325 "buffer is too small (need {} bytes, but got {})",
26326 Self::ENCODED_LEN,
26327 __tmp.remaining(),
26328 )
26329 }
26330 __tmp.put_u64_le(self.time_usec);
26331 __tmp.put_i16_le(self.press_abs);
26332 __tmp.put_i16_le(self.press_diff1);
26333 __tmp.put_i16_le(self.press_diff2);
26334 __tmp.put_i16_le(self.temperature);
26335 if matches!(version, MavlinkVersion::V2) {
26336 let len = __tmp.len();
26337 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26338 } else {
26339 __tmp.len()
26340 }
26341 }
26342}
26343#[doc = "RPM sensor data message."]
26344#[doc = ""]
26345#[doc = "ID: 339"]
26346#[derive(Debug, Clone, PartialEq)]
26347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26348#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26349#[cfg_attr(feature = "ts", derive(TS))]
26350#[cfg_attr(feature = "ts", ts(export))]
26351pub struct RAW_RPM_DATA {
26352 #[doc = "Indicated rate"]
26353 pub frequency: f32,
26354 #[doc = "Index of this RPM sensor (0-indexed)"]
26355 pub index: u8,
26356}
26357impl RAW_RPM_DATA {
26358 pub const ENCODED_LEN: usize = 5usize;
26359 pub const DEFAULT: Self = Self {
26360 frequency: 0.0_f32,
26361 index: 0_u8,
26362 };
26363 #[cfg(feature = "arbitrary")]
26364 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26365 use arbitrary::{Arbitrary, Unstructured};
26366 let mut buf = [0u8; 1024];
26367 rng.fill_bytes(&mut buf);
26368 let mut unstructured = Unstructured::new(&buf);
26369 Self::arbitrary(&mut unstructured).unwrap_or_default()
26370 }
26371}
26372impl Default for RAW_RPM_DATA {
26373 fn default() -> Self {
26374 Self::DEFAULT.clone()
26375 }
26376}
26377impl MessageData for RAW_RPM_DATA {
26378 type Message = MavMessage;
26379 const ID: u32 = 339u32;
26380 const NAME: &'static str = "RAW_RPM";
26381 const EXTRA_CRC: u8 = 199u8;
26382 const ENCODED_LEN: usize = 5usize;
26383 fn deser(
26384 _version: MavlinkVersion,
26385 __input: &[u8],
26386 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26387 let avail_len = __input.len();
26388 let mut payload_buf = [0; Self::ENCODED_LEN];
26389 let mut buf = if avail_len < Self::ENCODED_LEN {
26390 payload_buf[0..avail_len].copy_from_slice(__input);
26391 Bytes::new(&payload_buf)
26392 } else {
26393 Bytes::new(__input)
26394 };
26395 let mut __struct = Self::default();
26396 __struct.frequency = buf.get_f32_le();
26397 __struct.index = buf.get_u8();
26398 Ok(__struct)
26399 }
26400 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26401 let mut __tmp = BytesMut::new(bytes);
26402 #[allow(clippy::absurd_extreme_comparisons)]
26403 #[allow(unused_comparisons)]
26404 if __tmp.remaining() < Self::ENCODED_LEN {
26405 panic!(
26406 "buffer is too small (need {} bytes, but got {})",
26407 Self::ENCODED_LEN,
26408 __tmp.remaining(),
26409 )
26410 }
26411 __tmp.put_f32_le(self.frequency);
26412 __tmp.put_u8(self.index);
26413 if matches!(version, MavlinkVersion::V2) {
26414 let len = __tmp.len();
26415 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26416 } else {
26417 __tmp.len()
26418 }
26419 }
26420}
26421#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
26422#[doc = ""]
26423#[doc = "ID: 65"]
26424#[derive(Debug, Clone, PartialEq)]
26425#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26426#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26427#[cfg_attr(feature = "ts", derive(TS))]
26428#[cfg_attr(feature = "ts", ts(export))]
26429pub struct RC_CHANNELS_DATA {
26430 #[doc = "Timestamp (time since system boot)."]
26431 pub time_boot_ms: u32,
26432 #[doc = "RC channel 1 value."]
26433 pub chan1_raw: u16,
26434 #[doc = "RC channel 2 value."]
26435 pub chan2_raw: u16,
26436 #[doc = "RC channel 3 value."]
26437 pub chan3_raw: u16,
26438 #[doc = "RC channel 4 value."]
26439 pub chan4_raw: u16,
26440 #[doc = "RC channel 5 value."]
26441 pub chan5_raw: u16,
26442 #[doc = "RC channel 6 value."]
26443 pub chan6_raw: u16,
26444 #[doc = "RC channel 7 value."]
26445 pub chan7_raw: u16,
26446 #[doc = "RC channel 8 value."]
26447 pub chan8_raw: u16,
26448 #[doc = "RC channel 9 value."]
26449 pub chan9_raw: u16,
26450 #[doc = "RC channel 10 value."]
26451 pub chan10_raw: u16,
26452 #[doc = "RC channel 11 value."]
26453 pub chan11_raw: u16,
26454 #[doc = "RC channel 12 value."]
26455 pub chan12_raw: u16,
26456 #[doc = "RC channel 13 value."]
26457 pub chan13_raw: u16,
26458 #[doc = "RC channel 14 value."]
26459 pub chan14_raw: u16,
26460 #[doc = "RC channel 15 value."]
26461 pub chan15_raw: u16,
26462 #[doc = "RC channel 16 value."]
26463 pub chan16_raw: u16,
26464 #[doc = "RC channel 17 value."]
26465 pub chan17_raw: u16,
26466 #[doc = "RC channel 18 value."]
26467 pub chan18_raw: u16,
26468 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
26469 pub chancount: u8,
26470 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26471 pub rssi: u8,
26472}
26473impl RC_CHANNELS_DATA {
26474 pub const ENCODED_LEN: usize = 42usize;
26475 pub const DEFAULT: Self = Self {
26476 time_boot_ms: 0_u32,
26477 chan1_raw: 0_u16,
26478 chan2_raw: 0_u16,
26479 chan3_raw: 0_u16,
26480 chan4_raw: 0_u16,
26481 chan5_raw: 0_u16,
26482 chan6_raw: 0_u16,
26483 chan7_raw: 0_u16,
26484 chan8_raw: 0_u16,
26485 chan9_raw: 0_u16,
26486 chan10_raw: 0_u16,
26487 chan11_raw: 0_u16,
26488 chan12_raw: 0_u16,
26489 chan13_raw: 0_u16,
26490 chan14_raw: 0_u16,
26491 chan15_raw: 0_u16,
26492 chan16_raw: 0_u16,
26493 chan17_raw: 0_u16,
26494 chan18_raw: 0_u16,
26495 chancount: 0_u8,
26496 rssi: 0_u8,
26497 };
26498 #[cfg(feature = "arbitrary")]
26499 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26500 use arbitrary::{Arbitrary, Unstructured};
26501 let mut buf = [0u8; 1024];
26502 rng.fill_bytes(&mut buf);
26503 let mut unstructured = Unstructured::new(&buf);
26504 Self::arbitrary(&mut unstructured).unwrap_or_default()
26505 }
26506}
26507impl Default for RC_CHANNELS_DATA {
26508 fn default() -> Self {
26509 Self::DEFAULT.clone()
26510 }
26511}
26512impl MessageData for RC_CHANNELS_DATA {
26513 type Message = MavMessage;
26514 const ID: u32 = 65u32;
26515 const NAME: &'static str = "RC_CHANNELS";
26516 const EXTRA_CRC: u8 = 118u8;
26517 const ENCODED_LEN: usize = 42usize;
26518 fn deser(
26519 _version: MavlinkVersion,
26520 __input: &[u8],
26521 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26522 let avail_len = __input.len();
26523 let mut payload_buf = [0; Self::ENCODED_LEN];
26524 let mut buf = if avail_len < Self::ENCODED_LEN {
26525 payload_buf[0..avail_len].copy_from_slice(__input);
26526 Bytes::new(&payload_buf)
26527 } else {
26528 Bytes::new(__input)
26529 };
26530 let mut __struct = Self::default();
26531 __struct.time_boot_ms = buf.get_u32_le();
26532 __struct.chan1_raw = buf.get_u16_le();
26533 __struct.chan2_raw = buf.get_u16_le();
26534 __struct.chan3_raw = buf.get_u16_le();
26535 __struct.chan4_raw = buf.get_u16_le();
26536 __struct.chan5_raw = buf.get_u16_le();
26537 __struct.chan6_raw = buf.get_u16_le();
26538 __struct.chan7_raw = buf.get_u16_le();
26539 __struct.chan8_raw = buf.get_u16_le();
26540 __struct.chan9_raw = buf.get_u16_le();
26541 __struct.chan10_raw = buf.get_u16_le();
26542 __struct.chan11_raw = buf.get_u16_le();
26543 __struct.chan12_raw = buf.get_u16_le();
26544 __struct.chan13_raw = buf.get_u16_le();
26545 __struct.chan14_raw = buf.get_u16_le();
26546 __struct.chan15_raw = buf.get_u16_le();
26547 __struct.chan16_raw = buf.get_u16_le();
26548 __struct.chan17_raw = buf.get_u16_le();
26549 __struct.chan18_raw = buf.get_u16_le();
26550 __struct.chancount = buf.get_u8();
26551 __struct.rssi = buf.get_u8();
26552 Ok(__struct)
26553 }
26554 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26555 let mut __tmp = BytesMut::new(bytes);
26556 #[allow(clippy::absurd_extreme_comparisons)]
26557 #[allow(unused_comparisons)]
26558 if __tmp.remaining() < Self::ENCODED_LEN {
26559 panic!(
26560 "buffer is too small (need {} bytes, but got {})",
26561 Self::ENCODED_LEN,
26562 __tmp.remaining(),
26563 )
26564 }
26565 __tmp.put_u32_le(self.time_boot_ms);
26566 __tmp.put_u16_le(self.chan1_raw);
26567 __tmp.put_u16_le(self.chan2_raw);
26568 __tmp.put_u16_le(self.chan3_raw);
26569 __tmp.put_u16_le(self.chan4_raw);
26570 __tmp.put_u16_le(self.chan5_raw);
26571 __tmp.put_u16_le(self.chan6_raw);
26572 __tmp.put_u16_le(self.chan7_raw);
26573 __tmp.put_u16_le(self.chan8_raw);
26574 __tmp.put_u16_le(self.chan9_raw);
26575 __tmp.put_u16_le(self.chan10_raw);
26576 __tmp.put_u16_le(self.chan11_raw);
26577 __tmp.put_u16_le(self.chan12_raw);
26578 __tmp.put_u16_le(self.chan13_raw);
26579 __tmp.put_u16_le(self.chan14_raw);
26580 __tmp.put_u16_le(self.chan15_raw);
26581 __tmp.put_u16_le(self.chan16_raw);
26582 __tmp.put_u16_le(self.chan17_raw);
26583 __tmp.put_u16_le(self.chan18_raw);
26584 __tmp.put_u8(self.chancount);
26585 __tmp.put_u8(self.rssi);
26586 if matches!(version, MavlinkVersion::V2) {
26587 let len = __tmp.len();
26588 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26589 } else {
26590 __tmp.len()
26591 }
26592 }
26593}
26594#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
26595#[doc = ""]
26596#[doc = "ID: 70"]
26597#[derive(Debug, Clone, PartialEq)]
26598#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26599#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26600#[cfg_attr(feature = "ts", derive(TS))]
26601#[cfg_attr(feature = "ts", ts(export))]
26602pub struct RC_CHANNELS_OVERRIDE_DATA {
26603 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26604 pub chan1_raw: u16,
26605 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26606 pub chan2_raw: u16,
26607 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26608 pub chan3_raw: u16,
26609 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26610 pub chan4_raw: u16,
26611 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26612 pub chan5_raw: u16,
26613 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26614 pub chan6_raw: u16,
26615 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26616 pub chan7_raw: u16,
26617 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26618 pub chan8_raw: u16,
26619 #[doc = "System ID"]
26620 pub target_system: u8,
26621 #[doc = "Component ID"]
26622 pub target_component: u8,
26623 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26624 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26625 pub chan9_raw: u16,
26626 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26627 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26628 pub chan10_raw: u16,
26629 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26630 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26631 pub chan11_raw: u16,
26632 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26633 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26634 pub chan12_raw: u16,
26635 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26636 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26637 pub chan13_raw: u16,
26638 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26639 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26640 pub chan14_raw: u16,
26641 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26642 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26643 pub chan15_raw: u16,
26644 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26645 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26646 pub chan16_raw: u16,
26647 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26648 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26649 pub chan17_raw: u16,
26650 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26651 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26652 pub chan18_raw: u16,
26653}
26654impl RC_CHANNELS_OVERRIDE_DATA {
26655 pub const ENCODED_LEN: usize = 38usize;
26656 pub const DEFAULT: Self = Self {
26657 chan1_raw: 0_u16,
26658 chan2_raw: 0_u16,
26659 chan3_raw: 0_u16,
26660 chan4_raw: 0_u16,
26661 chan5_raw: 0_u16,
26662 chan6_raw: 0_u16,
26663 chan7_raw: 0_u16,
26664 chan8_raw: 0_u16,
26665 target_system: 0_u8,
26666 target_component: 0_u8,
26667 chan9_raw: 0_u16,
26668 chan10_raw: 0_u16,
26669 chan11_raw: 0_u16,
26670 chan12_raw: 0_u16,
26671 chan13_raw: 0_u16,
26672 chan14_raw: 0_u16,
26673 chan15_raw: 0_u16,
26674 chan16_raw: 0_u16,
26675 chan17_raw: 0_u16,
26676 chan18_raw: 0_u16,
26677 };
26678 #[cfg(feature = "arbitrary")]
26679 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26680 use arbitrary::{Arbitrary, Unstructured};
26681 let mut buf = [0u8; 1024];
26682 rng.fill_bytes(&mut buf);
26683 let mut unstructured = Unstructured::new(&buf);
26684 Self::arbitrary(&mut unstructured).unwrap_or_default()
26685 }
26686}
26687impl Default for RC_CHANNELS_OVERRIDE_DATA {
26688 fn default() -> Self {
26689 Self::DEFAULT.clone()
26690 }
26691}
26692impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
26693 type Message = MavMessage;
26694 const ID: u32 = 70u32;
26695 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
26696 const EXTRA_CRC: u8 = 124u8;
26697 const ENCODED_LEN: usize = 38usize;
26698 fn deser(
26699 _version: MavlinkVersion,
26700 __input: &[u8],
26701 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26702 let avail_len = __input.len();
26703 let mut payload_buf = [0; Self::ENCODED_LEN];
26704 let mut buf = if avail_len < Self::ENCODED_LEN {
26705 payload_buf[0..avail_len].copy_from_slice(__input);
26706 Bytes::new(&payload_buf)
26707 } else {
26708 Bytes::new(__input)
26709 };
26710 let mut __struct = Self::default();
26711 __struct.chan1_raw = buf.get_u16_le();
26712 __struct.chan2_raw = buf.get_u16_le();
26713 __struct.chan3_raw = buf.get_u16_le();
26714 __struct.chan4_raw = buf.get_u16_le();
26715 __struct.chan5_raw = buf.get_u16_le();
26716 __struct.chan6_raw = buf.get_u16_le();
26717 __struct.chan7_raw = buf.get_u16_le();
26718 __struct.chan8_raw = buf.get_u16_le();
26719 __struct.target_system = buf.get_u8();
26720 __struct.target_component = buf.get_u8();
26721 __struct.chan9_raw = buf.get_u16_le();
26722 __struct.chan10_raw = buf.get_u16_le();
26723 __struct.chan11_raw = buf.get_u16_le();
26724 __struct.chan12_raw = buf.get_u16_le();
26725 __struct.chan13_raw = buf.get_u16_le();
26726 __struct.chan14_raw = buf.get_u16_le();
26727 __struct.chan15_raw = buf.get_u16_le();
26728 __struct.chan16_raw = buf.get_u16_le();
26729 __struct.chan17_raw = buf.get_u16_le();
26730 __struct.chan18_raw = buf.get_u16_le();
26731 Ok(__struct)
26732 }
26733 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26734 let mut __tmp = BytesMut::new(bytes);
26735 #[allow(clippy::absurd_extreme_comparisons)]
26736 #[allow(unused_comparisons)]
26737 if __tmp.remaining() < Self::ENCODED_LEN {
26738 panic!(
26739 "buffer is too small (need {} bytes, but got {})",
26740 Self::ENCODED_LEN,
26741 __tmp.remaining(),
26742 )
26743 }
26744 __tmp.put_u16_le(self.chan1_raw);
26745 __tmp.put_u16_le(self.chan2_raw);
26746 __tmp.put_u16_le(self.chan3_raw);
26747 __tmp.put_u16_le(self.chan4_raw);
26748 __tmp.put_u16_le(self.chan5_raw);
26749 __tmp.put_u16_le(self.chan6_raw);
26750 __tmp.put_u16_le(self.chan7_raw);
26751 __tmp.put_u16_le(self.chan8_raw);
26752 __tmp.put_u8(self.target_system);
26753 __tmp.put_u8(self.target_component);
26754 if matches!(version, MavlinkVersion::V2) {
26755 __tmp.put_u16_le(self.chan9_raw);
26756 __tmp.put_u16_le(self.chan10_raw);
26757 __tmp.put_u16_le(self.chan11_raw);
26758 __tmp.put_u16_le(self.chan12_raw);
26759 __tmp.put_u16_le(self.chan13_raw);
26760 __tmp.put_u16_le(self.chan14_raw);
26761 __tmp.put_u16_le(self.chan15_raw);
26762 __tmp.put_u16_le(self.chan16_raw);
26763 __tmp.put_u16_le(self.chan17_raw);
26764 __tmp.put_u16_le(self.chan18_raw);
26765 let len = __tmp.len();
26766 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26767 } else {
26768 __tmp.len()
26769 }
26770 }
26771}
26772#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
26773#[doc = ""]
26774#[doc = "ID: 35"]
26775#[derive(Debug, Clone, PartialEq)]
26776#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26777#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26778#[cfg_attr(feature = "ts", derive(TS))]
26779#[cfg_attr(feature = "ts", ts(export))]
26780pub struct RC_CHANNELS_RAW_DATA {
26781 #[doc = "Timestamp (time since system boot)."]
26782 pub time_boot_ms: u32,
26783 #[doc = "RC channel 1 value."]
26784 pub chan1_raw: u16,
26785 #[doc = "RC channel 2 value."]
26786 pub chan2_raw: u16,
26787 #[doc = "RC channel 3 value."]
26788 pub chan3_raw: u16,
26789 #[doc = "RC channel 4 value."]
26790 pub chan4_raw: u16,
26791 #[doc = "RC channel 5 value."]
26792 pub chan5_raw: u16,
26793 #[doc = "RC channel 6 value."]
26794 pub chan6_raw: u16,
26795 #[doc = "RC channel 7 value."]
26796 pub chan7_raw: u16,
26797 #[doc = "RC channel 8 value."]
26798 pub chan8_raw: u16,
26799 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26800 pub port: u8,
26801 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26802 pub rssi: u8,
26803}
26804impl RC_CHANNELS_RAW_DATA {
26805 pub const ENCODED_LEN: usize = 22usize;
26806 pub const DEFAULT: Self = Self {
26807 time_boot_ms: 0_u32,
26808 chan1_raw: 0_u16,
26809 chan2_raw: 0_u16,
26810 chan3_raw: 0_u16,
26811 chan4_raw: 0_u16,
26812 chan5_raw: 0_u16,
26813 chan6_raw: 0_u16,
26814 chan7_raw: 0_u16,
26815 chan8_raw: 0_u16,
26816 port: 0_u8,
26817 rssi: 0_u8,
26818 };
26819 #[cfg(feature = "arbitrary")]
26820 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26821 use arbitrary::{Arbitrary, Unstructured};
26822 let mut buf = [0u8; 1024];
26823 rng.fill_bytes(&mut buf);
26824 let mut unstructured = Unstructured::new(&buf);
26825 Self::arbitrary(&mut unstructured).unwrap_or_default()
26826 }
26827}
26828impl Default for RC_CHANNELS_RAW_DATA {
26829 fn default() -> Self {
26830 Self::DEFAULT.clone()
26831 }
26832}
26833impl MessageData for RC_CHANNELS_RAW_DATA {
26834 type Message = MavMessage;
26835 const ID: u32 = 35u32;
26836 const NAME: &'static str = "RC_CHANNELS_RAW";
26837 const EXTRA_CRC: u8 = 244u8;
26838 const ENCODED_LEN: usize = 22usize;
26839 fn deser(
26840 _version: MavlinkVersion,
26841 __input: &[u8],
26842 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26843 let avail_len = __input.len();
26844 let mut payload_buf = [0; Self::ENCODED_LEN];
26845 let mut buf = if avail_len < Self::ENCODED_LEN {
26846 payload_buf[0..avail_len].copy_from_slice(__input);
26847 Bytes::new(&payload_buf)
26848 } else {
26849 Bytes::new(__input)
26850 };
26851 let mut __struct = Self::default();
26852 __struct.time_boot_ms = buf.get_u32_le();
26853 __struct.chan1_raw = buf.get_u16_le();
26854 __struct.chan2_raw = buf.get_u16_le();
26855 __struct.chan3_raw = buf.get_u16_le();
26856 __struct.chan4_raw = buf.get_u16_le();
26857 __struct.chan5_raw = buf.get_u16_le();
26858 __struct.chan6_raw = buf.get_u16_le();
26859 __struct.chan7_raw = buf.get_u16_le();
26860 __struct.chan8_raw = buf.get_u16_le();
26861 __struct.port = buf.get_u8();
26862 __struct.rssi = buf.get_u8();
26863 Ok(__struct)
26864 }
26865 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26866 let mut __tmp = BytesMut::new(bytes);
26867 #[allow(clippy::absurd_extreme_comparisons)]
26868 #[allow(unused_comparisons)]
26869 if __tmp.remaining() < Self::ENCODED_LEN {
26870 panic!(
26871 "buffer is too small (need {} bytes, but got {})",
26872 Self::ENCODED_LEN,
26873 __tmp.remaining(),
26874 )
26875 }
26876 __tmp.put_u32_le(self.time_boot_ms);
26877 __tmp.put_u16_le(self.chan1_raw);
26878 __tmp.put_u16_le(self.chan2_raw);
26879 __tmp.put_u16_le(self.chan3_raw);
26880 __tmp.put_u16_le(self.chan4_raw);
26881 __tmp.put_u16_le(self.chan5_raw);
26882 __tmp.put_u16_le(self.chan6_raw);
26883 __tmp.put_u16_le(self.chan7_raw);
26884 __tmp.put_u16_le(self.chan8_raw);
26885 __tmp.put_u8(self.port);
26886 __tmp.put_u8(self.rssi);
26887 if matches!(version, MavlinkVersion::V2) {
26888 let len = __tmp.len();
26889 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26890 } else {
26891 __tmp.len()
26892 }
26893 }
26894}
26895#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
26896#[doc = ""]
26897#[doc = "ID: 34"]
26898#[derive(Debug, Clone, PartialEq)]
26899#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26900#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26901#[cfg_attr(feature = "ts", derive(TS))]
26902#[cfg_attr(feature = "ts", ts(export))]
26903pub struct RC_CHANNELS_SCALED_DATA {
26904 #[doc = "Timestamp (time since system boot)."]
26905 pub time_boot_ms: u32,
26906 #[doc = "RC channel 1 value scaled."]
26907 pub chan1_scaled: i16,
26908 #[doc = "RC channel 2 value scaled."]
26909 pub chan2_scaled: i16,
26910 #[doc = "RC channel 3 value scaled."]
26911 pub chan3_scaled: i16,
26912 #[doc = "RC channel 4 value scaled."]
26913 pub chan4_scaled: i16,
26914 #[doc = "RC channel 5 value scaled."]
26915 pub chan5_scaled: i16,
26916 #[doc = "RC channel 6 value scaled."]
26917 pub chan6_scaled: i16,
26918 #[doc = "RC channel 7 value scaled."]
26919 pub chan7_scaled: i16,
26920 #[doc = "RC channel 8 value scaled."]
26921 pub chan8_scaled: i16,
26922 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26923 pub port: u8,
26924 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26925 pub rssi: u8,
26926}
26927impl RC_CHANNELS_SCALED_DATA {
26928 pub const ENCODED_LEN: usize = 22usize;
26929 pub const DEFAULT: Self = Self {
26930 time_boot_ms: 0_u32,
26931 chan1_scaled: 0_i16,
26932 chan2_scaled: 0_i16,
26933 chan3_scaled: 0_i16,
26934 chan4_scaled: 0_i16,
26935 chan5_scaled: 0_i16,
26936 chan6_scaled: 0_i16,
26937 chan7_scaled: 0_i16,
26938 chan8_scaled: 0_i16,
26939 port: 0_u8,
26940 rssi: 0_u8,
26941 };
26942 #[cfg(feature = "arbitrary")]
26943 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26944 use arbitrary::{Arbitrary, Unstructured};
26945 let mut buf = [0u8; 1024];
26946 rng.fill_bytes(&mut buf);
26947 let mut unstructured = Unstructured::new(&buf);
26948 Self::arbitrary(&mut unstructured).unwrap_or_default()
26949 }
26950}
26951impl Default for RC_CHANNELS_SCALED_DATA {
26952 fn default() -> Self {
26953 Self::DEFAULT.clone()
26954 }
26955}
26956impl MessageData for RC_CHANNELS_SCALED_DATA {
26957 type Message = MavMessage;
26958 const ID: u32 = 34u32;
26959 const NAME: &'static str = "RC_CHANNELS_SCALED";
26960 const EXTRA_CRC: u8 = 237u8;
26961 const ENCODED_LEN: usize = 22usize;
26962 fn deser(
26963 _version: MavlinkVersion,
26964 __input: &[u8],
26965 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26966 let avail_len = __input.len();
26967 let mut payload_buf = [0; Self::ENCODED_LEN];
26968 let mut buf = if avail_len < Self::ENCODED_LEN {
26969 payload_buf[0..avail_len].copy_from_slice(__input);
26970 Bytes::new(&payload_buf)
26971 } else {
26972 Bytes::new(__input)
26973 };
26974 let mut __struct = Self::default();
26975 __struct.time_boot_ms = buf.get_u32_le();
26976 __struct.chan1_scaled = buf.get_i16_le();
26977 __struct.chan2_scaled = buf.get_i16_le();
26978 __struct.chan3_scaled = buf.get_i16_le();
26979 __struct.chan4_scaled = buf.get_i16_le();
26980 __struct.chan5_scaled = buf.get_i16_le();
26981 __struct.chan6_scaled = buf.get_i16_le();
26982 __struct.chan7_scaled = buf.get_i16_le();
26983 __struct.chan8_scaled = buf.get_i16_le();
26984 __struct.port = buf.get_u8();
26985 __struct.rssi = buf.get_u8();
26986 Ok(__struct)
26987 }
26988 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26989 let mut __tmp = BytesMut::new(bytes);
26990 #[allow(clippy::absurd_extreme_comparisons)]
26991 #[allow(unused_comparisons)]
26992 if __tmp.remaining() < Self::ENCODED_LEN {
26993 panic!(
26994 "buffer is too small (need {} bytes, but got {})",
26995 Self::ENCODED_LEN,
26996 __tmp.remaining(),
26997 )
26998 }
26999 __tmp.put_u32_le(self.time_boot_ms);
27000 __tmp.put_i16_le(self.chan1_scaled);
27001 __tmp.put_i16_le(self.chan2_scaled);
27002 __tmp.put_i16_le(self.chan3_scaled);
27003 __tmp.put_i16_le(self.chan4_scaled);
27004 __tmp.put_i16_le(self.chan5_scaled);
27005 __tmp.put_i16_le(self.chan6_scaled);
27006 __tmp.put_i16_le(self.chan7_scaled);
27007 __tmp.put_i16_le(self.chan8_scaled);
27008 __tmp.put_u8(self.port);
27009 __tmp.put_u8(self.rssi);
27010 if matches!(version, MavlinkVersion::V2) {
27011 let len = __tmp.len();
27012 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27013 } else {
27014 __tmp.len()
27015 }
27016 }
27017}
27018#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
27019#[doc = "Request a data stream."]
27020#[doc = ""]
27021#[doc = "ID: 66"]
27022#[derive(Debug, Clone, PartialEq)]
27023#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27024#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27025#[cfg_attr(feature = "ts", derive(TS))]
27026#[cfg_attr(feature = "ts", ts(export))]
27027pub struct REQUEST_DATA_STREAM_DATA {
27028 #[doc = "The requested message rate"]
27029 pub req_message_rate: u16,
27030 #[doc = "The target requested to send the message stream."]
27031 pub target_system: u8,
27032 #[doc = "The target requested to send the message stream."]
27033 pub target_component: u8,
27034 #[doc = "The ID of the requested data stream"]
27035 pub req_stream_id: u8,
27036 #[doc = "1 to start sending, 0 to stop sending."]
27037 pub start_stop: u8,
27038}
27039impl REQUEST_DATA_STREAM_DATA {
27040 pub const ENCODED_LEN: usize = 6usize;
27041 pub const DEFAULT: Self = Self {
27042 req_message_rate: 0_u16,
27043 target_system: 0_u8,
27044 target_component: 0_u8,
27045 req_stream_id: 0_u8,
27046 start_stop: 0_u8,
27047 };
27048 #[cfg(feature = "arbitrary")]
27049 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27050 use arbitrary::{Arbitrary, Unstructured};
27051 let mut buf = [0u8; 1024];
27052 rng.fill_bytes(&mut buf);
27053 let mut unstructured = Unstructured::new(&buf);
27054 Self::arbitrary(&mut unstructured).unwrap_or_default()
27055 }
27056}
27057impl Default for REQUEST_DATA_STREAM_DATA {
27058 fn default() -> Self {
27059 Self::DEFAULT.clone()
27060 }
27061}
27062impl MessageData for REQUEST_DATA_STREAM_DATA {
27063 type Message = MavMessage;
27064 const ID: u32 = 66u32;
27065 const NAME: &'static str = "REQUEST_DATA_STREAM";
27066 const EXTRA_CRC: u8 = 148u8;
27067 const ENCODED_LEN: usize = 6usize;
27068 fn deser(
27069 _version: MavlinkVersion,
27070 __input: &[u8],
27071 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27072 let avail_len = __input.len();
27073 let mut payload_buf = [0; Self::ENCODED_LEN];
27074 let mut buf = if avail_len < Self::ENCODED_LEN {
27075 payload_buf[0..avail_len].copy_from_slice(__input);
27076 Bytes::new(&payload_buf)
27077 } else {
27078 Bytes::new(__input)
27079 };
27080 let mut __struct = Self::default();
27081 __struct.req_message_rate = buf.get_u16_le();
27082 __struct.target_system = buf.get_u8();
27083 __struct.target_component = buf.get_u8();
27084 __struct.req_stream_id = buf.get_u8();
27085 __struct.start_stop = buf.get_u8();
27086 Ok(__struct)
27087 }
27088 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27089 let mut __tmp = BytesMut::new(bytes);
27090 #[allow(clippy::absurd_extreme_comparisons)]
27091 #[allow(unused_comparisons)]
27092 if __tmp.remaining() < Self::ENCODED_LEN {
27093 panic!(
27094 "buffer is too small (need {} bytes, but got {})",
27095 Self::ENCODED_LEN,
27096 __tmp.remaining(),
27097 )
27098 }
27099 __tmp.put_u16_le(self.req_message_rate);
27100 __tmp.put_u8(self.target_system);
27101 __tmp.put_u8(self.target_component);
27102 __tmp.put_u8(self.req_stream_id);
27103 __tmp.put_u8(self.start_stop);
27104 if matches!(version, MavlinkVersion::V2) {
27105 let len = __tmp.len();
27106 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27107 } else {
27108 __tmp.len()
27109 }
27110 }
27111}
27112#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
27113#[doc = ""]
27114#[doc = "ID: 412"]
27115#[derive(Debug, Clone, PartialEq)]
27116#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27117#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27118#[cfg_attr(feature = "ts", derive(TS))]
27119#[cfg_attr(feature = "ts", ts(export))]
27120pub struct REQUEST_EVENT_DATA {
27121 #[doc = "First sequence number of the requested event."]
27122 pub first_sequence: u16,
27123 #[doc = "Last sequence number of the requested event."]
27124 pub last_sequence: u16,
27125 #[doc = "System ID"]
27126 pub target_system: u8,
27127 #[doc = "Component ID"]
27128 pub target_component: u8,
27129}
27130impl REQUEST_EVENT_DATA {
27131 pub const ENCODED_LEN: usize = 6usize;
27132 pub const DEFAULT: Self = Self {
27133 first_sequence: 0_u16,
27134 last_sequence: 0_u16,
27135 target_system: 0_u8,
27136 target_component: 0_u8,
27137 };
27138 #[cfg(feature = "arbitrary")]
27139 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27140 use arbitrary::{Arbitrary, Unstructured};
27141 let mut buf = [0u8; 1024];
27142 rng.fill_bytes(&mut buf);
27143 let mut unstructured = Unstructured::new(&buf);
27144 Self::arbitrary(&mut unstructured).unwrap_or_default()
27145 }
27146}
27147impl Default for REQUEST_EVENT_DATA {
27148 fn default() -> Self {
27149 Self::DEFAULT.clone()
27150 }
27151}
27152impl MessageData for REQUEST_EVENT_DATA {
27153 type Message = MavMessage;
27154 const ID: u32 = 412u32;
27155 const NAME: &'static str = "REQUEST_EVENT";
27156 const EXTRA_CRC: u8 = 33u8;
27157 const ENCODED_LEN: usize = 6usize;
27158 fn deser(
27159 _version: MavlinkVersion,
27160 __input: &[u8],
27161 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27162 let avail_len = __input.len();
27163 let mut payload_buf = [0; Self::ENCODED_LEN];
27164 let mut buf = if avail_len < Self::ENCODED_LEN {
27165 payload_buf[0..avail_len].copy_from_slice(__input);
27166 Bytes::new(&payload_buf)
27167 } else {
27168 Bytes::new(__input)
27169 };
27170 let mut __struct = Self::default();
27171 __struct.first_sequence = buf.get_u16_le();
27172 __struct.last_sequence = buf.get_u16_le();
27173 __struct.target_system = buf.get_u8();
27174 __struct.target_component = buf.get_u8();
27175 Ok(__struct)
27176 }
27177 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27178 let mut __tmp = BytesMut::new(bytes);
27179 #[allow(clippy::absurd_extreme_comparisons)]
27180 #[allow(unused_comparisons)]
27181 if __tmp.remaining() < Self::ENCODED_LEN {
27182 panic!(
27183 "buffer is too small (need {} bytes, but got {})",
27184 Self::ENCODED_LEN,
27185 __tmp.remaining(),
27186 )
27187 }
27188 __tmp.put_u16_le(self.first_sequence);
27189 __tmp.put_u16_le(self.last_sequence);
27190 __tmp.put_u8(self.target_system);
27191 __tmp.put_u8(self.target_component);
27192 if matches!(version, MavlinkVersion::V2) {
27193 let len = __tmp.len();
27194 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27195 } else {
27196 __tmp.len()
27197 }
27198 }
27199}
27200#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
27201#[doc = ""]
27202#[doc = "ID: 142"]
27203#[derive(Debug, Clone, PartialEq)]
27204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27206#[cfg_attr(feature = "ts", derive(TS))]
27207#[cfg_attr(feature = "ts", ts(export))]
27208pub struct RESOURCE_REQUEST_DATA {
27209 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
27210 pub request_id: u8,
27211 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
27212 pub uri_type: u8,
27213 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
27214 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27215 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27216 pub uri: [u8; 120],
27217 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
27218 pub transfer_type: u8,
27219 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
27220 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27221 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27222 pub storage: [u8; 120],
27223}
27224impl RESOURCE_REQUEST_DATA {
27225 pub const ENCODED_LEN: usize = 243usize;
27226 pub const DEFAULT: Self = Self {
27227 request_id: 0_u8,
27228 uri_type: 0_u8,
27229 uri: [0_u8; 120usize],
27230 transfer_type: 0_u8,
27231 storage: [0_u8; 120usize],
27232 };
27233 #[cfg(feature = "arbitrary")]
27234 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27235 use arbitrary::{Arbitrary, Unstructured};
27236 let mut buf = [0u8; 1024];
27237 rng.fill_bytes(&mut buf);
27238 let mut unstructured = Unstructured::new(&buf);
27239 Self::arbitrary(&mut unstructured).unwrap_or_default()
27240 }
27241}
27242impl Default for RESOURCE_REQUEST_DATA {
27243 fn default() -> Self {
27244 Self::DEFAULT.clone()
27245 }
27246}
27247impl MessageData for RESOURCE_REQUEST_DATA {
27248 type Message = MavMessage;
27249 const ID: u32 = 142u32;
27250 const NAME: &'static str = "RESOURCE_REQUEST";
27251 const EXTRA_CRC: u8 = 72u8;
27252 const ENCODED_LEN: usize = 243usize;
27253 fn deser(
27254 _version: MavlinkVersion,
27255 __input: &[u8],
27256 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27257 let avail_len = __input.len();
27258 let mut payload_buf = [0; Self::ENCODED_LEN];
27259 let mut buf = if avail_len < Self::ENCODED_LEN {
27260 payload_buf[0..avail_len].copy_from_slice(__input);
27261 Bytes::new(&payload_buf)
27262 } else {
27263 Bytes::new(__input)
27264 };
27265 let mut __struct = Self::default();
27266 __struct.request_id = buf.get_u8();
27267 __struct.uri_type = buf.get_u8();
27268 for v in &mut __struct.uri {
27269 let val = buf.get_u8();
27270 *v = val;
27271 }
27272 __struct.transfer_type = buf.get_u8();
27273 for v in &mut __struct.storage {
27274 let val = buf.get_u8();
27275 *v = val;
27276 }
27277 Ok(__struct)
27278 }
27279 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27280 let mut __tmp = BytesMut::new(bytes);
27281 #[allow(clippy::absurd_extreme_comparisons)]
27282 #[allow(unused_comparisons)]
27283 if __tmp.remaining() < Self::ENCODED_LEN {
27284 panic!(
27285 "buffer is too small (need {} bytes, but got {})",
27286 Self::ENCODED_LEN,
27287 __tmp.remaining(),
27288 )
27289 }
27290 __tmp.put_u8(self.request_id);
27291 __tmp.put_u8(self.uri_type);
27292 for val in &self.uri {
27293 __tmp.put_u8(*val);
27294 }
27295 __tmp.put_u8(self.transfer_type);
27296 for val in &self.storage {
27297 __tmp.put_u8(*val);
27298 }
27299 if matches!(version, MavlinkVersion::V2) {
27300 let len = __tmp.len();
27301 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27302 } else {
27303 __tmp.len()
27304 }
27305 }
27306}
27307#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
27308#[doc = ""]
27309#[doc = "ID: 413"]
27310#[derive(Debug, Clone, PartialEq)]
27311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27312#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27313#[cfg_attr(feature = "ts", derive(TS))]
27314#[cfg_attr(feature = "ts", ts(export))]
27315pub struct RESPONSE_EVENT_ERROR_DATA {
27316 #[doc = "Sequence number."]
27317 pub sequence: u16,
27318 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
27319 pub sequence_oldest_available: u16,
27320 #[doc = "System ID"]
27321 pub target_system: u8,
27322 #[doc = "Component ID"]
27323 pub target_component: u8,
27324 #[doc = "Error reason."]
27325 pub reason: MavEventErrorReason,
27326}
27327impl RESPONSE_EVENT_ERROR_DATA {
27328 pub const ENCODED_LEN: usize = 7usize;
27329 pub const DEFAULT: Self = Self {
27330 sequence: 0_u16,
27331 sequence_oldest_available: 0_u16,
27332 target_system: 0_u8,
27333 target_component: 0_u8,
27334 reason: MavEventErrorReason::DEFAULT,
27335 };
27336 #[cfg(feature = "arbitrary")]
27337 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27338 use arbitrary::{Arbitrary, Unstructured};
27339 let mut buf = [0u8; 1024];
27340 rng.fill_bytes(&mut buf);
27341 let mut unstructured = Unstructured::new(&buf);
27342 Self::arbitrary(&mut unstructured).unwrap_or_default()
27343 }
27344}
27345impl Default for RESPONSE_EVENT_ERROR_DATA {
27346 fn default() -> Self {
27347 Self::DEFAULT.clone()
27348 }
27349}
27350impl MessageData for RESPONSE_EVENT_ERROR_DATA {
27351 type Message = MavMessage;
27352 const ID: u32 = 413u32;
27353 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
27354 const EXTRA_CRC: u8 = 77u8;
27355 const ENCODED_LEN: usize = 7usize;
27356 fn deser(
27357 _version: MavlinkVersion,
27358 __input: &[u8],
27359 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27360 let avail_len = __input.len();
27361 let mut payload_buf = [0; Self::ENCODED_LEN];
27362 let mut buf = if avail_len < Self::ENCODED_LEN {
27363 payload_buf[0..avail_len].copy_from_slice(__input);
27364 Bytes::new(&payload_buf)
27365 } else {
27366 Bytes::new(__input)
27367 };
27368 let mut __struct = Self::default();
27369 __struct.sequence = buf.get_u16_le();
27370 __struct.sequence_oldest_available = buf.get_u16_le();
27371 __struct.target_system = buf.get_u8();
27372 __struct.target_component = buf.get_u8();
27373 let tmp = buf.get_u8();
27374 __struct.reason =
27375 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27376 enum_type: "MavEventErrorReason",
27377 value: tmp as u32,
27378 })?;
27379 Ok(__struct)
27380 }
27381 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27382 let mut __tmp = BytesMut::new(bytes);
27383 #[allow(clippy::absurd_extreme_comparisons)]
27384 #[allow(unused_comparisons)]
27385 if __tmp.remaining() < Self::ENCODED_LEN {
27386 panic!(
27387 "buffer is too small (need {} bytes, but got {})",
27388 Self::ENCODED_LEN,
27389 __tmp.remaining(),
27390 )
27391 }
27392 __tmp.put_u16_le(self.sequence);
27393 __tmp.put_u16_le(self.sequence_oldest_available);
27394 __tmp.put_u8(self.target_system);
27395 __tmp.put_u8(self.target_component);
27396 __tmp.put_u8(self.reason as u8);
27397 if matches!(version, MavlinkVersion::V2) {
27398 let len = __tmp.len();
27399 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27400 } else {
27401 __tmp.len()
27402 }
27403 }
27404}
27405#[doc = "Read out the safety zone the MAV currently assumes."]
27406#[doc = ""]
27407#[doc = "ID: 55"]
27408#[derive(Debug, Clone, PartialEq)]
27409#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27410#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27411#[cfg_attr(feature = "ts", derive(TS))]
27412#[cfg_attr(feature = "ts", ts(export))]
27413pub struct SAFETY_ALLOWED_AREA_DATA {
27414 #[doc = "x position 1 / Latitude 1"]
27415 pub p1x: f32,
27416 #[doc = "y position 1 / Longitude 1"]
27417 pub p1y: f32,
27418 #[doc = "z position 1 / Altitude 1"]
27419 pub p1z: f32,
27420 #[doc = "x position 2 / Latitude 2"]
27421 pub p2x: f32,
27422 #[doc = "y position 2 / Longitude 2"]
27423 pub p2y: f32,
27424 #[doc = "z position 2 / Altitude 2"]
27425 pub p2z: f32,
27426 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
27427 pub frame: MavFrame,
27428}
27429impl SAFETY_ALLOWED_AREA_DATA {
27430 pub const ENCODED_LEN: usize = 25usize;
27431 pub const DEFAULT: Self = Self {
27432 p1x: 0.0_f32,
27433 p1y: 0.0_f32,
27434 p1z: 0.0_f32,
27435 p2x: 0.0_f32,
27436 p2y: 0.0_f32,
27437 p2z: 0.0_f32,
27438 frame: MavFrame::DEFAULT,
27439 };
27440 #[cfg(feature = "arbitrary")]
27441 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27442 use arbitrary::{Arbitrary, Unstructured};
27443 let mut buf = [0u8; 1024];
27444 rng.fill_bytes(&mut buf);
27445 let mut unstructured = Unstructured::new(&buf);
27446 Self::arbitrary(&mut unstructured).unwrap_or_default()
27447 }
27448}
27449impl Default for SAFETY_ALLOWED_AREA_DATA {
27450 fn default() -> Self {
27451 Self::DEFAULT.clone()
27452 }
27453}
27454impl MessageData for SAFETY_ALLOWED_AREA_DATA {
27455 type Message = MavMessage;
27456 const ID: u32 = 55u32;
27457 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
27458 const EXTRA_CRC: u8 = 3u8;
27459 const ENCODED_LEN: usize = 25usize;
27460 fn deser(
27461 _version: MavlinkVersion,
27462 __input: &[u8],
27463 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27464 let avail_len = __input.len();
27465 let mut payload_buf = [0; Self::ENCODED_LEN];
27466 let mut buf = if avail_len < Self::ENCODED_LEN {
27467 payload_buf[0..avail_len].copy_from_slice(__input);
27468 Bytes::new(&payload_buf)
27469 } else {
27470 Bytes::new(__input)
27471 };
27472 let mut __struct = Self::default();
27473 __struct.p1x = buf.get_f32_le();
27474 __struct.p1y = buf.get_f32_le();
27475 __struct.p1z = buf.get_f32_le();
27476 __struct.p2x = buf.get_f32_le();
27477 __struct.p2y = buf.get_f32_le();
27478 __struct.p2z = buf.get_f32_le();
27479 let tmp = buf.get_u8();
27480 __struct.frame =
27481 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27482 enum_type: "MavFrame",
27483 value: tmp as u32,
27484 })?;
27485 Ok(__struct)
27486 }
27487 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27488 let mut __tmp = BytesMut::new(bytes);
27489 #[allow(clippy::absurd_extreme_comparisons)]
27490 #[allow(unused_comparisons)]
27491 if __tmp.remaining() < Self::ENCODED_LEN {
27492 panic!(
27493 "buffer is too small (need {} bytes, but got {})",
27494 Self::ENCODED_LEN,
27495 __tmp.remaining(),
27496 )
27497 }
27498 __tmp.put_f32_le(self.p1x);
27499 __tmp.put_f32_le(self.p1y);
27500 __tmp.put_f32_le(self.p1z);
27501 __tmp.put_f32_le(self.p2x);
27502 __tmp.put_f32_le(self.p2y);
27503 __tmp.put_f32_le(self.p2z);
27504 __tmp.put_u8(self.frame as u8);
27505 if matches!(version, MavlinkVersion::V2) {
27506 let len = __tmp.len();
27507 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27508 } else {
27509 __tmp.len()
27510 }
27511 }
27512}
27513#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
27514#[doc = ""]
27515#[doc = "ID: 54"]
27516#[derive(Debug, Clone, PartialEq)]
27517#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27518#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27519#[cfg_attr(feature = "ts", derive(TS))]
27520#[cfg_attr(feature = "ts", ts(export))]
27521pub struct SAFETY_SET_ALLOWED_AREA_DATA {
27522 #[doc = "x position 1 / Latitude 1"]
27523 pub p1x: f32,
27524 #[doc = "y position 1 / Longitude 1"]
27525 pub p1y: f32,
27526 #[doc = "z position 1 / Altitude 1"]
27527 pub p1z: f32,
27528 #[doc = "x position 2 / Latitude 2"]
27529 pub p2x: f32,
27530 #[doc = "y position 2 / Longitude 2"]
27531 pub p2y: f32,
27532 #[doc = "z position 2 / Altitude 2"]
27533 pub p2z: f32,
27534 #[doc = "System ID"]
27535 pub target_system: u8,
27536 #[doc = "Component ID"]
27537 pub target_component: u8,
27538 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
27539 pub frame: MavFrame,
27540}
27541impl SAFETY_SET_ALLOWED_AREA_DATA {
27542 pub const ENCODED_LEN: usize = 27usize;
27543 pub const DEFAULT: Self = Self {
27544 p1x: 0.0_f32,
27545 p1y: 0.0_f32,
27546 p1z: 0.0_f32,
27547 p2x: 0.0_f32,
27548 p2y: 0.0_f32,
27549 p2z: 0.0_f32,
27550 target_system: 0_u8,
27551 target_component: 0_u8,
27552 frame: MavFrame::DEFAULT,
27553 };
27554 #[cfg(feature = "arbitrary")]
27555 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27556 use arbitrary::{Arbitrary, Unstructured};
27557 let mut buf = [0u8; 1024];
27558 rng.fill_bytes(&mut buf);
27559 let mut unstructured = Unstructured::new(&buf);
27560 Self::arbitrary(&mut unstructured).unwrap_or_default()
27561 }
27562}
27563impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
27564 fn default() -> Self {
27565 Self::DEFAULT.clone()
27566 }
27567}
27568impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
27569 type Message = MavMessage;
27570 const ID: u32 = 54u32;
27571 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
27572 const EXTRA_CRC: u8 = 15u8;
27573 const ENCODED_LEN: usize = 27usize;
27574 fn deser(
27575 _version: MavlinkVersion,
27576 __input: &[u8],
27577 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27578 let avail_len = __input.len();
27579 let mut payload_buf = [0; Self::ENCODED_LEN];
27580 let mut buf = if avail_len < Self::ENCODED_LEN {
27581 payload_buf[0..avail_len].copy_from_slice(__input);
27582 Bytes::new(&payload_buf)
27583 } else {
27584 Bytes::new(__input)
27585 };
27586 let mut __struct = Self::default();
27587 __struct.p1x = buf.get_f32_le();
27588 __struct.p1y = buf.get_f32_le();
27589 __struct.p1z = buf.get_f32_le();
27590 __struct.p2x = buf.get_f32_le();
27591 __struct.p2y = buf.get_f32_le();
27592 __struct.p2z = buf.get_f32_le();
27593 __struct.target_system = buf.get_u8();
27594 __struct.target_component = buf.get_u8();
27595 let tmp = buf.get_u8();
27596 __struct.frame =
27597 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27598 enum_type: "MavFrame",
27599 value: tmp as u32,
27600 })?;
27601 Ok(__struct)
27602 }
27603 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27604 let mut __tmp = BytesMut::new(bytes);
27605 #[allow(clippy::absurd_extreme_comparisons)]
27606 #[allow(unused_comparisons)]
27607 if __tmp.remaining() < Self::ENCODED_LEN {
27608 panic!(
27609 "buffer is too small (need {} bytes, but got {})",
27610 Self::ENCODED_LEN,
27611 __tmp.remaining(),
27612 )
27613 }
27614 __tmp.put_f32_le(self.p1x);
27615 __tmp.put_f32_le(self.p1y);
27616 __tmp.put_f32_le(self.p1z);
27617 __tmp.put_f32_le(self.p2x);
27618 __tmp.put_f32_le(self.p2y);
27619 __tmp.put_f32_le(self.p2z);
27620 __tmp.put_u8(self.target_system);
27621 __tmp.put_u8(self.target_component);
27622 __tmp.put_u8(self.frame as u8);
27623 if matches!(version, MavlinkVersion::V2) {
27624 let len = __tmp.len();
27625 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27626 } else {
27627 __tmp.len()
27628 }
27629 }
27630}
27631#[doc = "Status of the SatCom link."]
27632#[doc = ""]
27633#[doc = "ID: 8015"]
27634#[derive(Debug, Clone, PartialEq)]
27635#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27636#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27637#[cfg_attr(feature = "ts", derive(TS))]
27638#[cfg_attr(feature = "ts", ts(export))]
27639pub struct SATCOM_LINK_STATUS_DATA {
27640 #[doc = "Timestamp"]
27641 pub timestamp: u64,
27642 #[doc = "Timestamp of the last successful sbd session"]
27643 pub last_heartbeat: u64,
27644 #[doc = "Number of failed sessions"]
27645 pub failed_sessions: u16,
27646 #[doc = "Number of successful sessions"]
27647 pub successful_sessions: u16,
27648 #[doc = "Signal quality"]
27649 pub signal_quality: u8,
27650 #[doc = "Ring call pending"]
27651 pub ring_pending: u8,
27652 #[doc = "Transmission session pending"]
27653 pub tx_session_pending: u8,
27654 #[doc = "Receiving session pending"]
27655 pub rx_session_pending: u8,
27656}
27657impl SATCOM_LINK_STATUS_DATA {
27658 pub const ENCODED_LEN: usize = 24usize;
27659 pub const DEFAULT: Self = Self {
27660 timestamp: 0_u64,
27661 last_heartbeat: 0_u64,
27662 failed_sessions: 0_u16,
27663 successful_sessions: 0_u16,
27664 signal_quality: 0_u8,
27665 ring_pending: 0_u8,
27666 tx_session_pending: 0_u8,
27667 rx_session_pending: 0_u8,
27668 };
27669 #[cfg(feature = "arbitrary")]
27670 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27671 use arbitrary::{Arbitrary, Unstructured};
27672 let mut buf = [0u8; 1024];
27673 rng.fill_bytes(&mut buf);
27674 let mut unstructured = Unstructured::new(&buf);
27675 Self::arbitrary(&mut unstructured).unwrap_or_default()
27676 }
27677}
27678impl Default for SATCOM_LINK_STATUS_DATA {
27679 fn default() -> Self {
27680 Self::DEFAULT.clone()
27681 }
27682}
27683impl MessageData for SATCOM_LINK_STATUS_DATA {
27684 type Message = MavMessage;
27685 const ID: u32 = 8015u32;
27686 const NAME: &'static str = "SATCOM_LINK_STATUS";
27687 const EXTRA_CRC: u8 = 23u8;
27688 const ENCODED_LEN: usize = 24usize;
27689 fn deser(
27690 _version: MavlinkVersion,
27691 __input: &[u8],
27692 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27693 let avail_len = __input.len();
27694 let mut payload_buf = [0; Self::ENCODED_LEN];
27695 let mut buf = if avail_len < Self::ENCODED_LEN {
27696 payload_buf[0..avail_len].copy_from_slice(__input);
27697 Bytes::new(&payload_buf)
27698 } else {
27699 Bytes::new(__input)
27700 };
27701 let mut __struct = Self::default();
27702 __struct.timestamp = buf.get_u64_le();
27703 __struct.last_heartbeat = buf.get_u64_le();
27704 __struct.failed_sessions = buf.get_u16_le();
27705 __struct.successful_sessions = buf.get_u16_le();
27706 __struct.signal_quality = buf.get_u8();
27707 __struct.ring_pending = buf.get_u8();
27708 __struct.tx_session_pending = buf.get_u8();
27709 __struct.rx_session_pending = buf.get_u8();
27710 Ok(__struct)
27711 }
27712 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27713 let mut __tmp = BytesMut::new(bytes);
27714 #[allow(clippy::absurd_extreme_comparisons)]
27715 #[allow(unused_comparisons)]
27716 if __tmp.remaining() < Self::ENCODED_LEN {
27717 panic!(
27718 "buffer is too small (need {} bytes, but got {})",
27719 Self::ENCODED_LEN,
27720 __tmp.remaining(),
27721 )
27722 }
27723 __tmp.put_u64_le(self.timestamp);
27724 __tmp.put_u64_le(self.last_heartbeat);
27725 __tmp.put_u16_le(self.failed_sessions);
27726 __tmp.put_u16_le(self.successful_sessions);
27727 __tmp.put_u8(self.signal_quality);
27728 __tmp.put_u8(self.ring_pending);
27729 __tmp.put_u8(self.tx_session_pending);
27730 __tmp.put_u8(self.rx_session_pending);
27731 if matches!(version, MavlinkVersion::V2) {
27732 let len = __tmp.len();
27733 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27734 } else {
27735 __tmp.len()
27736 }
27737 }
27738}
27739#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
27740#[doc = ""]
27741#[doc = "ID: 26"]
27742#[derive(Debug, Clone, PartialEq)]
27743#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27744#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27745#[cfg_attr(feature = "ts", derive(TS))]
27746#[cfg_attr(feature = "ts", ts(export))]
27747pub struct SCALED_IMU_DATA {
27748 #[doc = "Timestamp (time since system boot)."]
27749 pub time_boot_ms: u32,
27750 #[doc = "X acceleration"]
27751 pub xacc: i16,
27752 #[doc = "Y acceleration"]
27753 pub yacc: i16,
27754 #[doc = "Z acceleration"]
27755 pub zacc: i16,
27756 #[doc = "Angular speed around X axis"]
27757 pub xgyro: i16,
27758 #[doc = "Angular speed around Y axis"]
27759 pub ygyro: i16,
27760 #[doc = "Angular speed around Z axis"]
27761 pub zgyro: i16,
27762 #[doc = "X Magnetic field"]
27763 pub xmag: i16,
27764 #[doc = "Y Magnetic field"]
27765 pub ymag: i16,
27766 #[doc = "Z Magnetic field"]
27767 pub zmag: i16,
27768 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27769 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27770 pub temperature: i16,
27771}
27772impl SCALED_IMU_DATA {
27773 pub const ENCODED_LEN: usize = 24usize;
27774 pub const DEFAULT: Self = Self {
27775 time_boot_ms: 0_u32,
27776 xacc: 0_i16,
27777 yacc: 0_i16,
27778 zacc: 0_i16,
27779 xgyro: 0_i16,
27780 ygyro: 0_i16,
27781 zgyro: 0_i16,
27782 xmag: 0_i16,
27783 ymag: 0_i16,
27784 zmag: 0_i16,
27785 temperature: 0_i16,
27786 };
27787 #[cfg(feature = "arbitrary")]
27788 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27789 use arbitrary::{Arbitrary, Unstructured};
27790 let mut buf = [0u8; 1024];
27791 rng.fill_bytes(&mut buf);
27792 let mut unstructured = Unstructured::new(&buf);
27793 Self::arbitrary(&mut unstructured).unwrap_or_default()
27794 }
27795}
27796impl Default for SCALED_IMU_DATA {
27797 fn default() -> Self {
27798 Self::DEFAULT.clone()
27799 }
27800}
27801impl MessageData for SCALED_IMU_DATA {
27802 type Message = MavMessage;
27803 const ID: u32 = 26u32;
27804 const NAME: &'static str = "SCALED_IMU";
27805 const EXTRA_CRC: u8 = 170u8;
27806 const ENCODED_LEN: usize = 24usize;
27807 fn deser(
27808 _version: MavlinkVersion,
27809 __input: &[u8],
27810 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27811 let avail_len = __input.len();
27812 let mut payload_buf = [0; Self::ENCODED_LEN];
27813 let mut buf = if avail_len < Self::ENCODED_LEN {
27814 payload_buf[0..avail_len].copy_from_slice(__input);
27815 Bytes::new(&payload_buf)
27816 } else {
27817 Bytes::new(__input)
27818 };
27819 let mut __struct = Self::default();
27820 __struct.time_boot_ms = buf.get_u32_le();
27821 __struct.xacc = buf.get_i16_le();
27822 __struct.yacc = buf.get_i16_le();
27823 __struct.zacc = buf.get_i16_le();
27824 __struct.xgyro = buf.get_i16_le();
27825 __struct.ygyro = buf.get_i16_le();
27826 __struct.zgyro = buf.get_i16_le();
27827 __struct.xmag = buf.get_i16_le();
27828 __struct.ymag = buf.get_i16_le();
27829 __struct.zmag = buf.get_i16_le();
27830 __struct.temperature = buf.get_i16_le();
27831 Ok(__struct)
27832 }
27833 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27834 let mut __tmp = BytesMut::new(bytes);
27835 #[allow(clippy::absurd_extreme_comparisons)]
27836 #[allow(unused_comparisons)]
27837 if __tmp.remaining() < Self::ENCODED_LEN {
27838 panic!(
27839 "buffer is too small (need {} bytes, but got {})",
27840 Self::ENCODED_LEN,
27841 __tmp.remaining(),
27842 )
27843 }
27844 __tmp.put_u32_le(self.time_boot_ms);
27845 __tmp.put_i16_le(self.xacc);
27846 __tmp.put_i16_le(self.yacc);
27847 __tmp.put_i16_le(self.zacc);
27848 __tmp.put_i16_le(self.xgyro);
27849 __tmp.put_i16_le(self.ygyro);
27850 __tmp.put_i16_le(self.zgyro);
27851 __tmp.put_i16_le(self.xmag);
27852 __tmp.put_i16_le(self.ymag);
27853 __tmp.put_i16_le(self.zmag);
27854 if matches!(version, MavlinkVersion::V2) {
27855 __tmp.put_i16_le(self.temperature);
27856 let len = __tmp.len();
27857 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27858 } else {
27859 __tmp.len()
27860 }
27861 }
27862}
27863#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
27864#[doc = ""]
27865#[doc = "ID: 116"]
27866#[derive(Debug, Clone, PartialEq)]
27867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27868#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27869#[cfg_attr(feature = "ts", derive(TS))]
27870#[cfg_attr(feature = "ts", ts(export))]
27871pub struct SCALED_IMU2_DATA {
27872 #[doc = "Timestamp (time since system boot)."]
27873 pub time_boot_ms: u32,
27874 #[doc = "X acceleration"]
27875 pub xacc: i16,
27876 #[doc = "Y acceleration"]
27877 pub yacc: i16,
27878 #[doc = "Z acceleration"]
27879 pub zacc: i16,
27880 #[doc = "Angular speed around X axis"]
27881 pub xgyro: i16,
27882 #[doc = "Angular speed around Y axis"]
27883 pub ygyro: i16,
27884 #[doc = "Angular speed around Z axis"]
27885 pub zgyro: i16,
27886 #[doc = "X Magnetic field"]
27887 pub xmag: i16,
27888 #[doc = "Y Magnetic field"]
27889 pub ymag: i16,
27890 #[doc = "Z Magnetic field"]
27891 pub zmag: i16,
27892 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27893 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27894 pub temperature: i16,
27895}
27896impl SCALED_IMU2_DATA {
27897 pub const ENCODED_LEN: usize = 24usize;
27898 pub const DEFAULT: Self = Self {
27899 time_boot_ms: 0_u32,
27900 xacc: 0_i16,
27901 yacc: 0_i16,
27902 zacc: 0_i16,
27903 xgyro: 0_i16,
27904 ygyro: 0_i16,
27905 zgyro: 0_i16,
27906 xmag: 0_i16,
27907 ymag: 0_i16,
27908 zmag: 0_i16,
27909 temperature: 0_i16,
27910 };
27911 #[cfg(feature = "arbitrary")]
27912 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27913 use arbitrary::{Arbitrary, Unstructured};
27914 let mut buf = [0u8; 1024];
27915 rng.fill_bytes(&mut buf);
27916 let mut unstructured = Unstructured::new(&buf);
27917 Self::arbitrary(&mut unstructured).unwrap_or_default()
27918 }
27919}
27920impl Default for SCALED_IMU2_DATA {
27921 fn default() -> Self {
27922 Self::DEFAULT.clone()
27923 }
27924}
27925impl MessageData for SCALED_IMU2_DATA {
27926 type Message = MavMessage;
27927 const ID: u32 = 116u32;
27928 const NAME: &'static str = "SCALED_IMU2";
27929 const EXTRA_CRC: u8 = 76u8;
27930 const ENCODED_LEN: usize = 24usize;
27931 fn deser(
27932 _version: MavlinkVersion,
27933 __input: &[u8],
27934 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27935 let avail_len = __input.len();
27936 let mut payload_buf = [0; Self::ENCODED_LEN];
27937 let mut buf = if avail_len < Self::ENCODED_LEN {
27938 payload_buf[0..avail_len].copy_from_slice(__input);
27939 Bytes::new(&payload_buf)
27940 } else {
27941 Bytes::new(__input)
27942 };
27943 let mut __struct = Self::default();
27944 __struct.time_boot_ms = buf.get_u32_le();
27945 __struct.xacc = buf.get_i16_le();
27946 __struct.yacc = buf.get_i16_le();
27947 __struct.zacc = buf.get_i16_le();
27948 __struct.xgyro = buf.get_i16_le();
27949 __struct.ygyro = buf.get_i16_le();
27950 __struct.zgyro = buf.get_i16_le();
27951 __struct.xmag = buf.get_i16_le();
27952 __struct.ymag = buf.get_i16_le();
27953 __struct.zmag = buf.get_i16_le();
27954 __struct.temperature = buf.get_i16_le();
27955 Ok(__struct)
27956 }
27957 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27958 let mut __tmp = BytesMut::new(bytes);
27959 #[allow(clippy::absurd_extreme_comparisons)]
27960 #[allow(unused_comparisons)]
27961 if __tmp.remaining() < Self::ENCODED_LEN {
27962 panic!(
27963 "buffer is too small (need {} bytes, but got {})",
27964 Self::ENCODED_LEN,
27965 __tmp.remaining(),
27966 )
27967 }
27968 __tmp.put_u32_le(self.time_boot_ms);
27969 __tmp.put_i16_le(self.xacc);
27970 __tmp.put_i16_le(self.yacc);
27971 __tmp.put_i16_le(self.zacc);
27972 __tmp.put_i16_le(self.xgyro);
27973 __tmp.put_i16_le(self.ygyro);
27974 __tmp.put_i16_le(self.zgyro);
27975 __tmp.put_i16_le(self.xmag);
27976 __tmp.put_i16_le(self.ymag);
27977 __tmp.put_i16_le(self.zmag);
27978 if matches!(version, MavlinkVersion::V2) {
27979 __tmp.put_i16_le(self.temperature);
27980 let len = __tmp.len();
27981 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27982 } else {
27983 __tmp.len()
27984 }
27985 }
27986}
27987#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
27988#[doc = ""]
27989#[doc = "ID: 129"]
27990#[derive(Debug, Clone, PartialEq)]
27991#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27992#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27993#[cfg_attr(feature = "ts", derive(TS))]
27994#[cfg_attr(feature = "ts", ts(export))]
27995pub struct SCALED_IMU3_DATA {
27996 #[doc = "Timestamp (time since system boot)."]
27997 pub time_boot_ms: u32,
27998 #[doc = "X acceleration"]
27999 pub xacc: i16,
28000 #[doc = "Y acceleration"]
28001 pub yacc: i16,
28002 #[doc = "Z acceleration"]
28003 pub zacc: i16,
28004 #[doc = "Angular speed around X axis"]
28005 pub xgyro: i16,
28006 #[doc = "Angular speed around Y axis"]
28007 pub ygyro: i16,
28008 #[doc = "Angular speed around Z axis"]
28009 pub zgyro: i16,
28010 #[doc = "X Magnetic field"]
28011 pub xmag: i16,
28012 #[doc = "Y Magnetic field"]
28013 pub ymag: i16,
28014 #[doc = "Z Magnetic field"]
28015 pub zmag: i16,
28016 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
28017 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28018 pub temperature: i16,
28019}
28020impl SCALED_IMU3_DATA {
28021 pub const ENCODED_LEN: usize = 24usize;
28022 pub const DEFAULT: Self = Self {
28023 time_boot_ms: 0_u32,
28024 xacc: 0_i16,
28025 yacc: 0_i16,
28026 zacc: 0_i16,
28027 xgyro: 0_i16,
28028 ygyro: 0_i16,
28029 zgyro: 0_i16,
28030 xmag: 0_i16,
28031 ymag: 0_i16,
28032 zmag: 0_i16,
28033 temperature: 0_i16,
28034 };
28035 #[cfg(feature = "arbitrary")]
28036 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28037 use arbitrary::{Arbitrary, Unstructured};
28038 let mut buf = [0u8; 1024];
28039 rng.fill_bytes(&mut buf);
28040 let mut unstructured = Unstructured::new(&buf);
28041 Self::arbitrary(&mut unstructured).unwrap_or_default()
28042 }
28043}
28044impl Default for SCALED_IMU3_DATA {
28045 fn default() -> Self {
28046 Self::DEFAULT.clone()
28047 }
28048}
28049impl MessageData for SCALED_IMU3_DATA {
28050 type Message = MavMessage;
28051 const ID: u32 = 129u32;
28052 const NAME: &'static str = "SCALED_IMU3";
28053 const EXTRA_CRC: u8 = 46u8;
28054 const ENCODED_LEN: usize = 24usize;
28055 fn deser(
28056 _version: MavlinkVersion,
28057 __input: &[u8],
28058 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28059 let avail_len = __input.len();
28060 let mut payload_buf = [0; Self::ENCODED_LEN];
28061 let mut buf = if avail_len < Self::ENCODED_LEN {
28062 payload_buf[0..avail_len].copy_from_slice(__input);
28063 Bytes::new(&payload_buf)
28064 } else {
28065 Bytes::new(__input)
28066 };
28067 let mut __struct = Self::default();
28068 __struct.time_boot_ms = buf.get_u32_le();
28069 __struct.xacc = buf.get_i16_le();
28070 __struct.yacc = buf.get_i16_le();
28071 __struct.zacc = buf.get_i16_le();
28072 __struct.xgyro = buf.get_i16_le();
28073 __struct.ygyro = buf.get_i16_le();
28074 __struct.zgyro = buf.get_i16_le();
28075 __struct.xmag = buf.get_i16_le();
28076 __struct.ymag = buf.get_i16_le();
28077 __struct.zmag = buf.get_i16_le();
28078 __struct.temperature = buf.get_i16_le();
28079 Ok(__struct)
28080 }
28081 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28082 let mut __tmp = BytesMut::new(bytes);
28083 #[allow(clippy::absurd_extreme_comparisons)]
28084 #[allow(unused_comparisons)]
28085 if __tmp.remaining() < Self::ENCODED_LEN {
28086 panic!(
28087 "buffer is too small (need {} bytes, but got {})",
28088 Self::ENCODED_LEN,
28089 __tmp.remaining(),
28090 )
28091 }
28092 __tmp.put_u32_le(self.time_boot_ms);
28093 __tmp.put_i16_le(self.xacc);
28094 __tmp.put_i16_le(self.yacc);
28095 __tmp.put_i16_le(self.zacc);
28096 __tmp.put_i16_le(self.xgyro);
28097 __tmp.put_i16_le(self.ygyro);
28098 __tmp.put_i16_le(self.zgyro);
28099 __tmp.put_i16_le(self.xmag);
28100 __tmp.put_i16_le(self.ymag);
28101 __tmp.put_i16_le(self.zmag);
28102 if matches!(version, MavlinkVersion::V2) {
28103 __tmp.put_i16_le(self.temperature);
28104 let len = __tmp.len();
28105 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28106 } else {
28107 __tmp.len()
28108 }
28109 }
28110}
28111#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
28112#[doc = ""]
28113#[doc = "ID: 29"]
28114#[derive(Debug, Clone, PartialEq)]
28115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28116#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28117#[cfg_attr(feature = "ts", derive(TS))]
28118#[cfg_attr(feature = "ts", ts(export))]
28119pub struct SCALED_PRESSURE_DATA {
28120 #[doc = "Timestamp (time since system boot)."]
28121 pub time_boot_ms: u32,
28122 #[doc = "Absolute pressure"]
28123 pub press_abs: f32,
28124 #[doc = "Differential pressure 1"]
28125 pub press_diff: f32,
28126 #[doc = "Absolute pressure temperature"]
28127 pub temperature: i16,
28128 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
28129 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28130 pub temperature_press_diff: i16,
28131}
28132impl SCALED_PRESSURE_DATA {
28133 pub const ENCODED_LEN: usize = 16usize;
28134 pub const DEFAULT: Self = Self {
28135 time_boot_ms: 0_u32,
28136 press_abs: 0.0_f32,
28137 press_diff: 0.0_f32,
28138 temperature: 0_i16,
28139 temperature_press_diff: 0_i16,
28140 };
28141 #[cfg(feature = "arbitrary")]
28142 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28143 use arbitrary::{Arbitrary, Unstructured};
28144 let mut buf = [0u8; 1024];
28145 rng.fill_bytes(&mut buf);
28146 let mut unstructured = Unstructured::new(&buf);
28147 Self::arbitrary(&mut unstructured).unwrap_or_default()
28148 }
28149}
28150impl Default for SCALED_PRESSURE_DATA {
28151 fn default() -> Self {
28152 Self::DEFAULT.clone()
28153 }
28154}
28155impl MessageData for SCALED_PRESSURE_DATA {
28156 type Message = MavMessage;
28157 const ID: u32 = 29u32;
28158 const NAME: &'static str = "SCALED_PRESSURE";
28159 const EXTRA_CRC: u8 = 115u8;
28160 const ENCODED_LEN: usize = 16usize;
28161 fn deser(
28162 _version: MavlinkVersion,
28163 __input: &[u8],
28164 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28165 let avail_len = __input.len();
28166 let mut payload_buf = [0; Self::ENCODED_LEN];
28167 let mut buf = if avail_len < Self::ENCODED_LEN {
28168 payload_buf[0..avail_len].copy_from_slice(__input);
28169 Bytes::new(&payload_buf)
28170 } else {
28171 Bytes::new(__input)
28172 };
28173 let mut __struct = Self::default();
28174 __struct.time_boot_ms = buf.get_u32_le();
28175 __struct.press_abs = buf.get_f32_le();
28176 __struct.press_diff = buf.get_f32_le();
28177 __struct.temperature = buf.get_i16_le();
28178 __struct.temperature_press_diff = buf.get_i16_le();
28179 Ok(__struct)
28180 }
28181 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28182 let mut __tmp = BytesMut::new(bytes);
28183 #[allow(clippy::absurd_extreme_comparisons)]
28184 #[allow(unused_comparisons)]
28185 if __tmp.remaining() < Self::ENCODED_LEN {
28186 panic!(
28187 "buffer is too small (need {} bytes, but got {})",
28188 Self::ENCODED_LEN,
28189 __tmp.remaining(),
28190 )
28191 }
28192 __tmp.put_u32_le(self.time_boot_ms);
28193 __tmp.put_f32_le(self.press_abs);
28194 __tmp.put_f32_le(self.press_diff);
28195 __tmp.put_i16_le(self.temperature);
28196 if matches!(version, MavlinkVersion::V2) {
28197 __tmp.put_i16_le(self.temperature_press_diff);
28198 let len = __tmp.len();
28199 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28200 } else {
28201 __tmp.len()
28202 }
28203 }
28204}
28205#[doc = "Barometer readings for 2nd barometer."]
28206#[doc = ""]
28207#[doc = "ID: 137"]
28208#[derive(Debug, Clone, PartialEq)]
28209#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28211#[cfg_attr(feature = "ts", derive(TS))]
28212#[cfg_attr(feature = "ts", ts(export))]
28213pub struct SCALED_PRESSURE2_DATA {
28214 #[doc = "Timestamp (time since system boot)."]
28215 pub time_boot_ms: u32,
28216 #[doc = "Absolute pressure"]
28217 pub press_abs: f32,
28218 #[doc = "Differential pressure"]
28219 pub press_diff: f32,
28220 #[doc = "Absolute pressure temperature"]
28221 pub temperature: i16,
28222 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
28223 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28224 pub temperature_press_diff: i16,
28225}
28226impl SCALED_PRESSURE2_DATA {
28227 pub const ENCODED_LEN: usize = 16usize;
28228 pub const DEFAULT: Self = Self {
28229 time_boot_ms: 0_u32,
28230 press_abs: 0.0_f32,
28231 press_diff: 0.0_f32,
28232 temperature: 0_i16,
28233 temperature_press_diff: 0_i16,
28234 };
28235 #[cfg(feature = "arbitrary")]
28236 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28237 use arbitrary::{Arbitrary, Unstructured};
28238 let mut buf = [0u8; 1024];
28239 rng.fill_bytes(&mut buf);
28240 let mut unstructured = Unstructured::new(&buf);
28241 Self::arbitrary(&mut unstructured).unwrap_or_default()
28242 }
28243}
28244impl Default for SCALED_PRESSURE2_DATA {
28245 fn default() -> Self {
28246 Self::DEFAULT.clone()
28247 }
28248}
28249impl MessageData for SCALED_PRESSURE2_DATA {
28250 type Message = MavMessage;
28251 const ID: u32 = 137u32;
28252 const NAME: &'static str = "SCALED_PRESSURE2";
28253 const EXTRA_CRC: u8 = 195u8;
28254 const ENCODED_LEN: usize = 16usize;
28255 fn deser(
28256 _version: MavlinkVersion,
28257 __input: &[u8],
28258 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28259 let avail_len = __input.len();
28260 let mut payload_buf = [0; Self::ENCODED_LEN];
28261 let mut buf = if avail_len < Self::ENCODED_LEN {
28262 payload_buf[0..avail_len].copy_from_slice(__input);
28263 Bytes::new(&payload_buf)
28264 } else {
28265 Bytes::new(__input)
28266 };
28267 let mut __struct = Self::default();
28268 __struct.time_boot_ms = buf.get_u32_le();
28269 __struct.press_abs = buf.get_f32_le();
28270 __struct.press_diff = buf.get_f32_le();
28271 __struct.temperature = buf.get_i16_le();
28272 __struct.temperature_press_diff = buf.get_i16_le();
28273 Ok(__struct)
28274 }
28275 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28276 let mut __tmp = BytesMut::new(bytes);
28277 #[allow(clippy::absurd_extreme_comparisons)]
28278 #[allow(unused_comparisons)]
28279 if __tmp.remaining() < Self::ENCODED_LEN {
28280 panic!(
28281 "buffer is too small (need {} bytes, but got {})",
28282 Self::ENCODED_LEN,
28283 __tmp.remaining(),
28284 )
28285 }
28286 __tmp.put_u32_le(self.time_boot_ms);
28287 __tmp.put_f32_le(self.press_abs);
28288 __tmp.put_f32_le(self.press_diff);
28289 __tmp.put_i16_le(self.temperature);
28290 if matches!(version, MavlinkVersion::V2) {
28291 __tmp.put_i16_le(self.temperature_press_diff);
28292 let len = __tmp.len();
28293 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28294 } else {
28295 __tmp.len()
28296 }
28297 }
28298}
28299#[doc = "Barometer readings for 3rd barometer."]
28300#[doc = ""]
28301#[doc = "ID: 143"]
28302#[derive(Debug, Clone, PartialEq)]
28303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28305#[cfg_attr(feature = "ts", derive(TS))]
28306#[cfg_attr(feature = "ts", ts(export))]
28307pub struct SCALED_PRESSURE3_DATA {
28308 #[doc = "Timestamp (time since system boot)."]
28309 pub time_boot_ms: u32,
28310 #[doc = "Absolute pressure"]
28311 pub press_abs: f32,
28312 #[doc = "Differential pressure"]
28313 pub press_diff: f32,
28314 #[doc = "Absolute pressure temperature"]
28315 pub temperature: i16,
28316 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
28317 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28318 pub temperature_press_diff: i16,
28319}
28320impl SCALED_PRESSURE3_DATA {
28321 pub const ENCODED_LEN: usize = 16usize;
28322 pub const DEFAULT: Self = Self {
28323 time_boot_ms: 0_u32,
28324 press_abs: 0.0_f32,
28325 press_diff: 0.0_f32,
28326 temperature: 0_i16,
28327 temperature_press_diff: 0_i16,
28328 };
28329 #[cfg(feature = "arbitrary")]
28330 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28331 use arbitrary::{Arbitrary, Unstructured};
28332 let mut buf = [0u8; 1024];
28333 rng.fill_bytes(&mut buf);
28334 let mut unstructured = Unstructured::new(&buf);
28335 Self::arbitrary(&mut unstructured).unwrap_or_default()
28336 }
28337}
28338impl Default for SCALED_PRESSURE3_DATA {
28339 fn default() -> Self {
28340 Self::DEFAULT.clone()
28341 }
28342}
28343impl MessageData for SCALED_PRESSURE3_DATA {
28344 type Message = MavMessage;
28345 const ID: u32 = 143u32;
28346 const NAME: &'static str = "SCALED_PRESSURE3";
28347 const EXTRA_CRC: u8 = 131u8;
28348 const ENCODED_LEN: usize = 16usize;
28349 fn deser(
28350 _version: MavlinkVersion,
28351 __input: &[u8],
28352 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28353 let avail_len = __input.len();
28354 let mut payload_buf = [0; Self::ENCODED_LEN];
28355 let mut buf = if avail_len < Self::ENCODED_LEN {
28356 payload_buf[0..avail_len].copy_from_slice(__input);
28357 Bytes::new(&payload_buf)
28358 } else {
28359 Bytes::new(__input)
28360 };
28361 let mut __struct = Self::default();
28362 __struct.time_boot_ms = buf.get_u32_le();
28363 __struct.press_abs = buf.get_f32_le();
28364 __struct.press_diff = buf.get_f32_le();
28365 __struct.temperature = buf.get_i16_le();
28366 __struct.temperature_press_diff = buf.get_i16_le();
28367 Ok(__struct)
28368 }
28369 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28370 let mut __tmp = BytesMut::new(bytes);
28371 #[allow(clippy::absurd_extreme_comparisons)]
28372 #[allow(unused_comparisons)]
28373 if __tmp.remaining() < Self::ENCODED_LEN {
28374 panic!(
28375 "buffer is too small (need {} bytes, but got {})",
28376 Self::ENCODED_LEN,
28377 __tmp.remaining(),
28378 )
28379 }
28380 __tmp.put_u32_le(self.time_boot_ms);
28381 __tmp.put_f32_le(self.press_abs);
28382 __tmp.put_f32_le(self.press_diff);
28383 __tmp.put_i16_le(self.temperature);
28384 if matches!(version, MavlinkVersion::V2) {
28385 __tmp.put_i16_le(self.temperature_press_diff);
28386 let len = __tmp.len();
28387 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28388 } else {
28389 __tmp.len()
28390 }
28391 }
28392}
28393#[doc = "Monitoring of sensorpod status."]
28394#[doc = ""]
28395#[doc = "ID: 8012"]
28396#[derive(Debug, Clone, PartialEq)]
28397#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28398#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28399#[cfg_attr(feature = "ts", derive(TS))]
28400#[cfg_attr(feature = "ts", ts(export))]
28401pub struct SENSORPOD_STATUS_DATA {
28402 #[doc = "Timestamp in linuxtime (since 1.1.1970)"]
28403 pub timestamp: u64,
28404 #[doc = "Free space available in recordings directory in [Gb] * 1e2"]
28405 pub free_space: u16,
28406 #[doc = "Rate of ROS topic 1"]
28407 pub visensor_rate_1: u8,
28408 #[doc = "Rate of ROS topic 2"]
28409 pub visensor_rate_2: u8,
28410 #[doc = "Rate of ROS topic 3"]
28411 pub visensor_rate_3: u8,
28412 #[doc = "Rate of ROS topic 4"]
28413 pub visensor_rate_4: u8,
28414 #[doc = "Number of recording nodes"]
28415 pub recording_nodes_count: u8,
28416 #[doc = "Temperature of sensorpod CPU in"]
28417 pub cpu_temp: u8,
28418}
28419impl SENSORPOD_STATUS_DATA {
28420 pub const ENCODED_LEN: usize = 16usize;
28421 pub const DEFAULT: Self = Self {
28422 timestamp: 0_u64,
28423 free_space: 0_u16,
28424 visensor_rate_1: 0_u8,
28425 visensor_rate_2: 0_u8,
28426 visensor_rate_3: 0_u8,
28427 visensor_rate_4: 0_u8,
28428 recording_nodes_count: 0_u8,
28429 cpu_temp: 0_u8,
28430 };
28431 #[cfg(feature = "arbitrary")]
28432 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28433 use arbitrary::{Arbitrary, Unstructured};
28434 let mut buf = [0u8; 1024];
28435 rng.fill_bytes(&mut buf);
28436 let mut unstructured = Unstructured::new(&buf);
28437 Self::arbitrary(&mut unstructured).unwrap_or_default()
28438 }
28439}
28440impl Default for SENSORPOD_STATUS_DATA {
28441 fn default() -> Self {
28442 Self::DEFAULT.clone()
28443 }
28444}
28445impl MessageData for SENSORPOD_STATUS_DATA {
28446 type Message = MavMessage;
28447 const ID: u32 = 8012u32;
28448 const NAME: &'static str = "SENSORPOD_STATUS";
28449 const EXTRA_CRC: u8 = 54u8;
28450 const ENCODED_LEN: usize = 16usize;
28451 fn deser(
28452 _version: MavlinkVersion,
28453 __input: &[u8],
28454 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28455 let avail_len = __input.len();
28456 let mut payload_buf = [0; Self::ENCODED_LEN];
28457 let mut buf = if avail_len < Self::ENCODED_LEN {
28458 payload_buf[0..avail_len].copy_from_slice(__input);
28459 Bytes::new(&payload_buf)
28460 } else {
28461 Bytes::new(__input)
28462 };
28463 let mut __struct = Self::default();
28464 __struct.timestamp = buf.get_u64_le();
28465 __struct.free_space = buf.get_u16_le();
28466 __struct.visensor_rate_1 = buf.get_u8();
28467 __struct.visensor_rate_2 = buf.get_u8();
28468 __struct.visensor_rate_3 = buf.get_u8();
28469 __struct.visensor_rate_4 = buf.get_u8();
28470 __struct.recording_nodes_count = buf.get_u8();
28471 __struct.cpu_temp = buf.get_u8();
28472 Ok(__struct)
28473 }
28474 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28475 let mut __tmp = BytesMut::new(bytes);
28476 #[allow(clippy::absurd_extreme_comparisons)]
28477 #[allow(unused_comparisons)]
28478 if __tmp.remaining() < Self::ENCODED_LEN {
28479 panic!(
28480 "buffer is too small (need {} bytes, but got {})",
28481 Self::ENCODED_LEN,
28482 __tmp.remaining(),
28483 )
28484 }
28485 __tmp.put_u64_le(self.timestamp);
28486 __tmp.put_u16_le(self.free_space);
28487 __tmp.put_u8(self.visensor_rate_1);
28488 __tmp.put_u8(self.visensor_rate_2);
28489 __tmp.put_u8(self.visensor_rate_3);
28490 __tmp.put_u8(self.visensor_rate_4);
28491 __tmp.put_u8(self.recording_nodes_count);
28492 __tmp.put_u8(self.cpu_temp);
28493 if matches!(version, MavlinkVersion::V2) {
28494 let len = __tmp.len();
28495 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28496 } else {
28497 __tmp.len()
28498 }
28499 }
28500}
28501#[doc = "Calibrated airflow angle measurements."]
28502#[doc = ""]
28503#[doc = "ID: 8016"]
28504#[derive(Debug, Clone, PartialEq)]
28505#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28507#[cfg_attr(feature = "ts", derive(TS))]
28508#[cfg_attr(feature = "ts", ts(export))]
28509pub struct SENSOR_AIRFLOW_ANGLES_DATA {
28510 #[doc = "Timestamp"]
28511 pub timestamp: u64,
28512 #[doc = "Angle of attack"]
28513 pub angleofattack: f32,
28514 #[doc = "Sideslip angle"]
28515 pub sideslip: f32,
28516 #[doc = "Angle of attack measurement valid"]
28517 pub angleofattack_valid: u8,
28518 #[doc = "Sideslip angle measurement valid"]
28519 pub sideslip_valid: u8,
28520}
28521impl SENSOR_AIRFLOW_ANGLES_DATA {
28522 pub const ENCODED_LEN: usize = 18usize;
28523 pub const DEFAULT: Self = Self {
28524 timestamp: 0_u64,
28525 angleofattack: 0.0_f32,
28526 sideslip: 0.0_f32,
28527 angleofattack_valid: 0_u8,
28528 sideslip_valid: 0_u8,
28529 };
28530 #[cfg(feature = "arbitrary")]
28531 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28532 use arbitrary::{Arbitrary, Unstructured};
28533 let mut buf = [0u8; 1024];
28534 rng.fill_bytes(&mut buf);
28535 let mut unstructured = Unstructured::new(&buf);
28536 Self::arbitrary(&mut unstructured).unwrap_or_default()
28537 }
28538}
28539impl Default for SENSOR_AIRFLOW_ANGLES_DATA {
28540 fn default() -> Self {
28541 Self::DEFAULT.clone()
28542 }
28543}
28544impl MessageData for SENSOR_AIRFLOW_ANGLES_DATA {
28545 type Message = MavMessage;
28546 const ID: u32 = 8016u32;
28547 const NAME: &'static str = "SENSOR_AIRFLOW_ANGLES";
28548 const EXTRA_CRC: u8 = 149u8;
28549 const ENCODED_LEN: usize = 18usize;
28550 fn deser(
28551 _version: MavlinkVersion,
28552 __input: &[u8],
28553 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28554 let avail_len = __input.len();
28555 let mut payload_buf = [0; Self::ENCODED_LEN];
28556 let mut buf = if avail_len < Self::ENCODED_LEN {
28557 payload_buf[0..avail_len].copy_from_slice(__input);
28558 Bytes::new(&payload_buf)
28559 } else {
28560 Bytes::new(__input)
28561 };
28562 let mut __struct = Self::default();
28563 __struct.timestamp = buf.get_u64_le();
28564 __struct.angleofattack = buf.get_f32_le();
28565 __struct.sideslip = buf.get_f32_le();
28566 __struct.angleofattack_valid = buf.get_u8();
28567 __struct.sideslip_valid = buf.get_u8();
28568 Ok(__struct)
28569 }
28570 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28571 let mut __tmp = BytesMut::new(bytes);
28572 #[allow(clippy::absurd_extreme_comparisons)]
28573 #[allow(unused_comparisons)]
28574 if __tmp.remaining() < Self::ENCODED_LEN {
28575 panic!(
28576 "buffer is too small (need {} bytes, but got {})",
28577 Self::ENCODED_LEN,
28578 __tmp.remaining(),
28579 )
28580 }
28581 __tmp.put_u64_le(self.timestamp);
28582 __tmp.put_f32_le(self.angleofattack);
28583 __tmp.put_f32_le(self.sideslip);
28584 __tmp.put_u8(self.angleofattack_valid);
28585 __tmp.put_u8(self.sideslip_valid);
28586 if matches!(version, MavlinkVersion::V2) {
28587 let len = __tmp.len();
28588 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28589 } else {
28590 __tmp.len()
28591 }
28592 }
28593}
28594#[doc = "Atmospheric sensors (temperature, humidity, ...)."]
28595#[doc = ""]
28596#[doc = "ID: 8009"]
28597#[derive(Debug, Clone, PartialEq)]
28598#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28599#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28600#[cfg_attr(feature = "ts", derive(TS))]
28601#[cfg_attr(feature = "ts", ts(export))]
28602pub struct SENS_ATMOS_DATA {
28603 #[doc = "Time since system boot"]
28604 pub timestamp: u64,
28605 #[doc = "Ambient temperature"]
28606 pub TempAmbient: f32,
28607 #[doc = "Relative humidity"]
28608 pub Humidity: f32,
28609}
28610impl SENS_ATMOS_DATA {
28611 pub const ENCODED_LEN: usize = 16usize;
28612 pub const DEFAULT: Self = Self {
28613 timestamp: 0_u64,
28614 TempAmbient: 0.0_f32,
28615 Humidity: 0.0_f32,
28616 };
28617 #[cfg(feature = "arbitrary")]
28618 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28619 use arbitrary::{Arbitrary, Unstructured};
28620 let mut buf = [0u8; 1024];
28621 rng.fill_bytes(&mut buf);
28622 let mut unstructured = Unstructured::new(&buf);
28623 Self::arbitrary(&mut unstructured).unwrap_or_default()
28624 }
28625}
28626impl Default for SENS_ATMOS_DATA {
28627 fn default() -> Self {
28628 Self::DEFAULT.clone()
28629 }
28630}
28631impl MessageData for SENS_ATMOS_DATA {
28632 type Message = MavMessage;
28633 const ID: u32 = 8009u32;
28634 const NAME: &'static str = "SENS_ATMOS";
28635 const EXTRA_CRC: u8 = 144u8;
28636 const ENCODED_LEN: usize = 16usize;
28637 fn deser(
28638 _version: MavlinkVersion,
28639 __input: &[u8],
28640 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28641 let avail_len = __input.len();
28642 let mut payload_buf = [0; Self::ENCODED_LEN];
28643 let mut buf = if avail_len < Self::ENCODED_LEN {
28644 payload_buf[0..avail_len].copy_from_slice(__input);
28645 Bytes::new(&payload_buf)
28646 } else {
28647 Bytes::new(__input)
28648 };
28649 let mut __struct = Self::default();
28650 __struct.timestamp = buf.get_u64_le();
28651 __struct.TempAmbient = buf.get_f32_le();
28652 __struct.Humidity = buf.get_f32_le();
28653 Ok(__struct)
28654 }
28655 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28656 let mut __tmp = BytesMut::new(bytes);
28657 #[allow(clippy::absurd_extreme_comparisons)]
28658 #[allow(unused_comparisons)]
28659 if __tmp.remaining() < Self::ENCODED_LEN {
28660 panic!(
28661 "buffer is too small (need {} bytes, but got {})",
28662 Self::ENCODED_LEN,
28663 __tmp.remaining(),
28664 )
28665 }
28666 __tmp.put_u64_le(self.timestamp);
28667 __tmp.put_f32_le(self.TempAmbient);
28668 __tmp.put_f32_le(self.Humidity);
28669 if matches!(version, MavlinkVersion::V2) {
28670 let len = __tmp.len();
28671 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28672 } else {
28673 __tmp.len()
28674 }
28675 }
28676}
28677#[doc = "Battery pack monitoring data for Li-Ion batteries."]
28678#[doc = ""]
28679#[doc = "ID: 8010"]
28680#[derive(Debug, Clone, PartialEq)]
28681#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28683#[cfg_attr(feature = "ts", derive(TS))]
28684#[cfg_attr(feature = "ts", ts(export))]
28685pub struct SENS_BATMON_DATA {
28686 #[doc = "Time since system start"]
28687 pub batmon_timestamp: u64,
28688 #[doc = "Battery pack temperature"]
28689 pub temperature: f32,
28690 #[doc = "Battery monitor safetystatus report bits in Hex"]
28691 pub safetystatus: u32,
28692 #[doc = "Battery monitor operation status report bits in Hex"]
28693 pub operationstatus: u32,
28694 #[doc = "Battery pack voltage"]
28695 pub voltage: u16,
28696 #[doc = "Battery pack current"]
28697 pub current: i16,
28698 #[doc = "Battery monitor status report bits in Hex"]
28699 pub batterystatus: u16,
28700 #[doc = "Battery monitor serial number in Hex"]
28701 pub serialnumber: u16,
28702 #[doc = "Battery pack cell 1 voltage"]
28703 pub cellvoltage1: u16,
28704 #[doc = "Battery pack cell 2 voltage"]
28705 pub cellvoltage2: u16,
28706 #[doc = "Battery pack cell 3 voltage"]
28707 pub cellvoltage3: u16,
28708 #[doc = "Battery pack cell 4 voltage"]
28709 pub cellvoltage4: u16,
28710 #[doc = "Battery pack cell 5 voltage"]
28711 pub cellvoltage5: u16,
28712 #[doc = "Battery pack cell 6 voltage"]
28713 pub cellvoltage6: u16,
28714 #[doc = "Battery pack state-of-charge"]
28715 pub SoC: u8,
28716}
28717impl SENS_BATMON_DATA {
28718 pub const ENCODED_LEN: usize = 41usize;
28719 pub const DEFAULT: Self = Self {
28720 batmon_timestamp: 0_u64,
28721 temperature: 0.0_f32,
28722 safetystatus: 0_u32,
28723 operationstatus: 0_u32,
28724 voltage: 0_u16,
28725 current: 0_i16,
28726 batterystatus: 0_u16,
28727 serialnumber: 0_u16,
28728 cellvoltage1: 0_u16,
28729 cellvoltage2: 0_u16,
28730 cellvoltage3: 0_u16,
28731 cellvoltage4: 0_u16,
28732 cellvoltage5: 0_u16,
28733 cellvoltage6: 0_u16,
28734 SoC: 0_u8,
28735 };
28736 #[cfg(feature = "arbitrary")]
28737 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28738 use arbitrary::{Arbitrary, Unstructured};
28739 let mut buf = [0u8; 1024];
28740 rng.fill_bytes(&mut buf);
28741 let mut unstructured = Unstructured::new(&buf);
28742 Self::arbitrary(&mut unstructured).unwrap_or_default()
28743 }
28744}
28745impl Default for SENS_BATMON_DATA {
28746 fn default() -> Self {
28747 Self::DEFAULT.clone()
28748 }
28749}
28750impl MessageData for SENS_BATMON_DATA {
28751 type Message = MavMessage;
28752 const ID: u32 = 8010u32;
28753 const NAME: &'static str = "SENS_BATMON";
28754 const EXTRA_CRC: u8 = 155u8;
28755 const ENCODED_LEN: usize = 41usize;
28756 fn deser(
28757 _version: MavlinkVersion,
28758 __input: &[u8],
28759 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28760 let avail_len = __input.len();
28761 let mut payload_buf = [0; Self::ENCODED_LEN];
28762 let mut buf = if avail_len < Self::ENCODED_LEN {
28763 payload_buf[0..avail_len].copy_from_slice(__input);
28764 Bytes::new(&payload_buf)
28765 } else {
28766 Bytes::new(__input)
28767 };
28768 let mut __struct = Self::default();
28769 __struct.batmon_timestamp = buf.get_u64_le();
28770 __struct.temperature = buf.get_f32_le();
28771 __struct.safetystatus = buf.get_u32_le();
28772 __struct.operationstatus = buf.get_u32_le();
28773 __struct.voltage = buf.get_u16_le();
28774 __struct.current = buf.get_i16_le();
28775 __struct.batterystatus = buf.get_u16_le();
28776 __struct.serialnumber = buf.get_u16_le();
28777 __struct.cellvoltage1 = buf.get_u16_le();
28778 __struct.cellvoltage2 = buf.get_u16_le();
28779 __struct.cellvoltage3 = buf.get_u16_le();
28780 __struct.cellvoltage4 = buf.get_u16_le();
28781 __struct.cellvoltage5 = buf.get_u16_le();
28782 __struct.cellvoltage6 = buf.get_u16_le();
28783 __struct.SoC = buf.get_u8();
28784 Ok(__struct)
28785 }
28786 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28787 let mut __tmp = BytesMut::new(bytes);
28788 #[allow(clippy::absurd_extreme_comparisons)]
28789 #[allow(unused_comparisons)]
28790 if __tmp.remaining() < Self::ENCODED_LEN {
28791 panic!(
28792 "buffer is too small (need {} bytes, but got {})",
28793 Self::ENCODED_LEN,
28794 __tmp.remaining(),
28795 )
28796 }
28797 __tmp.put_u64_le(self.batmon_timestamp);
28798 __tmp.put_f32_le(self.temperature);
28799 __tmp.put_u32_le(self.safetystatus);
28800 __tmp.put_u32_le(self.operationstatus);
28801 __tmp.put_u16_le(self.voltage);
28802 __tmp.put_i16_le(self.current);
28803 __tmp.put_u16_le(self.batterystatus);
28804 __tmp.put_u16_le(self.serialnumber);
28805 __tmp.put_u16_le(self.cellvoltage1);
28806 __tmp.put_u16_le(self.cellvoltage2);
28807 __tmp.put_u16_le(self.cellvoltage3);
28808 __tmp.put_u16_le(self.cellvoltage4);
28809 __tmp.put_u16_le(self.cellvoltage5);
28810 __tmp.put_u16_le(self.cellvoltage6);
28811 __tmp.put_u8(self.SoC);
28812 if matches!(version, MavlinkVersion::V2) {
28813 let len = __tmp.len();
28814 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28815 } else {
28816 __tmp.len()
28817 }
28818 }
28819}
28820#[doc = "Maximum Power Point Tracker (MPPT) sensor data for solar module power performance tracking."]
28821#[doc = ""]
28822#[doc = "ID: 8003"]
28823#[derive(Debug, Clone, PartialEq)]
28824#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28825#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28826#[cfg_attr(feature = "ts", derive(TS))]
28827#[cfg_attr(feature = "ts", ts(export))]
28828pub struct SENS_MPPT_DATA {
28829 #[doc = "MPPT last timestamp"]
28830 pub mppt_timestamp: u64,
28831 #[doc = "MPPT1 voltage"]
28832 pub mppt1_volt: f32,
28833 #[doc = "MPPT1 current"]
28834 pub mppt1_amp: f32,
28835 #[doc = "MPPT2 voltage"]
28836 pub mppt2_volt: f32,
28837 #[doc = "MPPT2 current"]
28838 pub mppt2_amp: f32,
28839 #[doc = "MPPT3 voltage"]
28840 pub mppt3_volt: f32,
28841 #[doc = "MPPT3 current"]
28842 pub mppt3_amp: f32,
28843 #[doc = "MPPT1 pwm"]
28844 pub mppt1_pwm: u16,
28845 #[doc = "MPPT2 pwm"]
28846 pub mppt2_pwm: u16,
28847 #[doc = "MPPT3 pwm"]
28848 pub mppt3_pwm: u16,
28849 #[doc = "MPPT1 status"]
28850 pub mppt1_status: u8,
28851 #[doc = "MPPT2 status"]
28852 pub mppt2_status: u8,
28853 #[doc = "MPPT3 status"]
28854 pub mppt3_status: u8,
28855}
28856impl SENS_MPPT_DATA {
28857 pub const ENCODED_LEN: usize = 41usize;
28858 pub const DEFAULT: Self = Self {
28859 mppt_timestamp: 0_u64,
28860 mppt1_volt: 0.0_f32,
28861 mppt1_amp: 0.0_f32,
28862 mppt2_volt: 0.0_f32,
28863 mppt2_amp: 0.0_f32,
28864 mppt3_volt: 0.0_f32,
28865 mppt3_amp: 0.0_f32,
28866 mppt1_pwm: 0_u16,
28867 mppt2_pwm: 0_u16,
28868 mppt3_pwm: 0_u16,
28869 mppt1_status: 0_u8,
28870 mppt2_status: 0_u8,
28871 mppt3_status: 0_u8,
28872 };
28873 #[cfg(feature = "arbitrary")]
28874 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28875 use arbitrary::{Arbitrary, Unstructured};
28876 let mut buf = [0u8; 1024];
28877 rng.fill_bytes(&mut buf);
28878 let mut unstructured = Unstructured::new(&buf);
28879 Self::arbitrary(&mut unstructured).unwrap_or_default()
28880 }
28881}
28882impl Default for SENS_MPPT_DATA {
28883 fn default() -> Self {
28884 Self::DEFAULT.clone()
28885 }
28886}
28887impl MessageData for SENS_MPPT_DATA {
28888 type Message = MavMessage;
28889 const ID: u32 = 8003u32;
28890 const NAME: &'static str = "SENS_MPPT";
28891 const EXTRA_CRC: u8 = 231u8;
28892 const ENCODED_LEN: usize = 41usize;
28893 fn deser(
28894 _version: MavlinkVersion,
28895 __input: &[u8],
28896 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28897 let avail_len = __input.len();
28898 let mut payload_buf = [0; Self::ENCODED_LEN];
28899 let mut buf = if avail_len < Self::ENCODED_LEN {
28900 payload_buf[0..avail_len].copy_from_slice(__input);
28901 Bytes::new(&payload_buf)
28902 } else {
28903 Bytes::new(__input)
28904 };
28905 let mut __struct = Self::default();
28906 __struct.mppt_timestamp = buf.get_u64_le();
28907 __struct.mppt1_volt = buf.get_f32_le();
28908 __struct.mppt1_amp = buf.get_f32_le();
28909 __struct.mppt2_volt = buf.get_f32_le();
28910 __struct.mppt2_amp = buf.get_f32_le();
28911 __struct.mppt3_volt = buf.get_f32_le();
28912 __struct.mppt3_amp = buf.get_f32_le();
28913 __struct.mppt1_pwm = buf.get_u16_le();
28914 __struct.mppt2_pwm = buf.get_u16_le();
28915 __struct.mppt3_pwm = buf.get_u16_le();
28916 __struct.mppt1_status = buf.get_u8();
28917 __struct.mppt2_status = buf.get_u8();
28918 __struct.mppt3_status = buf.get_u8();
28919 Ok(__struct)
28920 }
28921 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28922 let mut __tmp = BytesMut::new(bytes);
28923 #[allow(clippy::absurd_extreme_comparisons)]
28924 #[allow(unused_comparisons)]
28925 if __tmp.remaining() < Self::ENCODED_LEN {
28926 panic!(
28927 "buffer is too small (need {} bytes, but got {})",
28928 Self::ENCODED_LEN,
28929 __tmp.remaining(),
28930 )
28931 }
28932 __tmp.put_u64_le(self.mppt_timestamp);
28933 __tmp.put_f32_le(self.mppt1_volt);
28934 __tmp.put_f32_le(self.mppt1_amp);
28935 __tmp.put_f32_le(self.mppt2_volt);
28936 __tmp.put_f32_le(self.mppt2_amp);
28937 __tmp.put_f32_le(self.mppt3_volt);
28938 __tmp.put_f32_le(self.mppt3_amp);
28939 __tmp.put_u16_le(self.mppt1_pwm);
28940 __tmp.put_u16_le(self.mppt2_pwm);
28941 __tmp.put_u16_le(self.mppt3_pwm);
28942 __tmp.put_u8(self.mppt1_status);
28943 __tmp.put_u8(self.mppt2_status);
28944 __tmp.put_u8(self.mppt3_status);
28945 if matches!(version, MavlinkVersion::V2) {
28946 let len = __tmp.len();
28947 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28948 } else {
28949 __tmp.len()
28950 }
28951 }
28952}
28953#[doc = "Voltage and current sensor data."]
28954#[doc = ""]
28955#[doc = "ID: 8002"]
28956#[derive(Debug, Clone, PartialEq)]
28957#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28958#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28959#[cfg_attr(feature = "ts", derive(TS))]
28960#[cfg_attr(feature = "ts", ts(export))]
28961pub struct SENS_POWER_DATA {
28962 #[doc = "Power board voltage sensor reading"]
28963 pub adc121_vspb_volt: f32,
28964 #[doc = "Power board current sensor reading"]
28965 pub adc121_cspb_amp: f32,
28966 #[doc = "Board current sensor 1 reading"]
28967 pub adc121_cs1_amp: f32,
28968 #[doc = "Board current sensor 2 reading"]
28969 pub adc121_cs2_amp: f32,
28970}
28971impl SENS_POWER_DATA {
28972 pub const ENCODED_LEN: usize = 16usize;
28973 pub const DEFAULT: Self = Self {
28974 adc121_vspb_volt: 0.0_f32,
28975 adc121_cspb_amp: 0.0_f32,
28976 adc121_cs1_amp: 0.0_f32,
28977 adc121_cs2_amp: 0.0_f32,
28978 };
28979 #[cfg(feature = "arbitrary")]
28980 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28981 use arbitrary::{Arbitrary, Unstructured};
28982 let mut buf = [0u8; 1024];
28983 rng.fill_bytes(&mut buf);
28984 let mut unstructured = Unstructured::new(&buf);
28985 Self::arbitrary(&mut unstructured).unwrap_or_default()
28986 }
28987}
28988impl Default for SENS_POWER_DATA {
28989 fn default() -> Self {
28990 Self::DEFAULT.clone()
28991 }
28992}
28993impl MessageData for SENS_POWER_DATA {
28994 type Message = MavMessage;
28995 const ID: u32 = 8002u32;
28996 const NAME: &'static str = "SENS_POWER";
28997 const EXTRA_CRC: u8 = 218u8;
28998 const ENCODED_LEN: usize = 16usize;
28999 fn deser(
29000 _version: MavlinkVersion,
29001 __input: &[u8],
29002 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29003 let avail_len = __input.len();
29004 let mut payload_buf = [0; Self::ENCODED_LEN];
29005 let mut buf = if avail_len < Self::ENCODED_LEN {
29006 payload_buf[0..avail_len].copy_from_slice(__input);
29007 Bytes::new(&payload_buf)
29008 } else {
29009 Bytes::new(__input)
29010 };
29011 let mut __struct = Self::default();
29012 __struct.adc121_vspb_volt = buf.get_f32_le();
29013 __struct.adc121_cspb_amp = buf.get_f32_le();
29014 __struct.adc121_cs1_amp = buf.get_f32_le();
29015 __struct.adc121_cs2_amp = buf.get_f32_le();
29016 Ok(__struct)
29017 }
29018 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29019 let mut __tmp = BytesMut::new(bytes);
29020 #[allow(clippy::absurd_extreme_comparisons)]
29021 #[allow(unused_comparisons)]
29022 if __tmp.remaining() < Self::ENCODED_LEN {
29023 panic!(
29024 "buffer is too small (need {} bytes, but got {})",
29025 Self::ENCODED_LEN,
29026 __tmp.remaining(),
29027 )
29028 }
29029 __tmp.put_f32_le(self.adc121_vspb_volt);
29030 __tmp.put_f32_le(self.adc121_cspb_amp);
29031 __tmp.put_f32_le(self.adc121_cs1_amp);
29032 __tmp.put_f32_le(self.adc121_cs2_amp);
29033 if matches!(version, MavlinkVersion::V2) {
29034 let len = __tmp.len();
29035 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29036 } else {
29037 __tmp.len()
29038 }
29039 }
29040}
29041#[doc = "Monitoring of power board status."]
29042#[doc = ""]
29043#[doc = "ID: 8013"]
29044#[derive(Debug, Clone, PartialEq)]
29045#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29046#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29047#[cfg_attr(feature = "ts", derive(TS))]
29048#[cfg_attr(feature = "ts", ts(export))]
29049pub struct SENS_POWER_BOARD_DATA {
29050 #[doc = "Timestamp"]
29051 pub timestamp: u64,
29052 #[doc = "Power board system voltage"]
29053 pub pwr_brd_system_volt: f32,
29054 #[doc = "Power board servo voltage"]
29055 pub pwr_brd_servo_volt: f32,
29056 #[doc = "Power board digital voltage"]
29057 pub pwr_brd_digital_volt: f32,
29058 #[doc = "Power board left motor current sensor"]
29059 pub pwr_brd_mot_l_amp: f32,
29060 #[doc = "Power board right motor current sensor"]
29061 pub pwr_brd_mot_r_amp: f32,
29062 #[doc = "Power board analog current sensor"]
29063 pub pwr_brd_analog_amp: f32,
29064 #[doc = "Power board digital current sensor"]
29065 pub pwr_brd_digital_amp: f32,
29066 #[doc = "Power board extension current sensor"]
29067 pub pwr_brd_ext_amp: f32,
29068 #[doc = "Power board aux current sensor"]
29069 pub pwr_brd_aux_amp: f32,
29070 #[doc = "Power board status register"]
29071 pub pwr_brd_status: u8,
29072 #[doc = "Power board leds status"]
29073 pub pwr_brd_led_status: u8,
29074}
29075impl SENS_POWER_BOARD_DATA {
29076 pub const ENCODED_LEN: usize = 46usize;
29077 pub const DEFAULT: Self = Self {
29078 timestamp: 0_u64,
29079 pwr_brd_system_volt: 0.0_f32,
29080 pwr_brd_servo_volt: 0.0_f32,
29081 pwr_brd_digital_volt: 0.0_f32,
29082 pwr_brd_mot_l_amp: 0.0_f32,
29083 pwr_brd_mot_r_amp: 0.0_f32,
29084 pwr_brd_analog_amp: 0.0_f32,
29085 pwr_brd_digital_amp: 0.0_f32,
29086 pwr_brd_ext_amp: 0.0_f32,
29087 pwr_brd_aux_amp: 0.0_f32,
29088 pwr_brd_status: 0_u8,
29089 pwr_brd_led_status: 0_u8,
29090 };
29091 #[cfg(feature = "arbitrary")]
29092 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29093 use arbitrary::{Arbitrary, Unstructured};
29094 let mut buf = [0u8; 1024];
29095 rng.fill_bytes(&mut buf);
29096 let mut unstructured = Unstructured::new(&buf);
29097 Self::arbitrary(&mut unstructured).unwrap_or_default()
29098 }
29099}
29100impl Default for SENS_POWER_BOARD_DATA {
29101 fn default() -> Self {
29102 Self::DEFAULT.clone()
29103 }
29104}
29105impl MessageData for SENS_POWER_BOARD_DATA {
29106 type Message = MavMessage;
29107 const ID: u32 = 8013u32;
29108 const NAME: &'static str = "SENS_POWER_BOARD";
29109 const EXTRA_CRC: u8 = 222u8;
29110 const ENCODED_LEN: usize = 46usize;
29111 fn deser(
29112 _version: MavlinkVersion,
29113 __input: &[u8],
29114 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29115 let avail_len = __input.len();
29116 let mut payload_buf = [0; Self::ENCODED_LEN];
29117 let mut buf = if avail_len < Self::ENCODED_LEN {
29118 payload_buf[0..avail_len].copy_from_slice(__input);
29119 Bytes::new(&payload_buf)
29120 } else {
29121 Bytes::new(__input)
29122 };
29123 let mut __struct = Self::default();
29124 __struct.timestamp = buf.get_u64_le();
29125 __struct.pwr_brd_system_volt = buf.get_f32_le();
29126 __struct.pwr_brd_servo_volt = buf.get_f32_le();
29127 __struct.pwr_brd_digital_volt = buf.get_f32_le();
29128 __struct.pwr_brd_mot_l_amp = buf.get_f32_le();
29129 __struct.pwr_brd_mot_r_amp = buf.get_f32_le();
29130 __struct.pwr_brd_analog_amp = buf.get_f32_le();
29131 __struct.pwr_brd_digital_amp = buf.get_f32_le();
29132 __struct.pwr_brd_ext_amp = buf.get_f32_le();
29133 __struct.pwr_brd_aux_amp = buf.get_f32_le();
29134 __struct.pwr_brd_status = buf.get_u8();
29135 __struct.pwr_brd_led_status = buf.get_u8();
29136 Ok(__struct)
29137 }
29138 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29139 let mut __tmp = BytesMut::new(bytes);
29140 #[allow(clippy::absurd_extreme_comparisons)]
29141 #[allow(unused_comparisons)]
29142 if __tmp.remaining() < Self::ENCODED_LEN {
29143 panic!(
29144 "buffer is too small (need {} bytes, but got {})",
29145 Self::ENCODED_LEN,
29146 __tmp.remaining(),
29147 )
29148 }
29149 __tmp.put_u64_le(self.timestamp);
29150 __tmp.put_f32_le(self.pwr_brd_system_volt);
29151 __tmp.put_f32_le(self.pwr_brd_servo_volt);
29152 __tmp.put_f32_le(self.pwr_brd_digital_volt);
29153 __tmp.put_f32_le(self.pwr_brd_mot_l_amp);
29154 __tmp.put_f32_le(self.pwr_brd_mot_r_amp);
29155 __tmp.put_f32_le(self.pwr_brd_analog_amp);
29156 __tmp.put_f32_le(self.pwr_brd_digital_amp);
29157 __tmp.put_f32_le(self.pwr_brd_ext_amp);
29158 __tmp.put_f32_le(self.pwr_brd_aux_amp);
29159 __tmp.put_u8(self.pwr_brd_status);
29160 __tmp.put_u8(self.pwr_brd_led_status);
29161 if matches!(version, MavlinkVersion::V2) {
29162 let len = __tmp.len();
29163 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29164 } else {
29165 __tmp.len()
29166 }
29167 }
29168}
29169#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
29170#[doc = ""]
29171#[doc = "ID: 126"]
29172#[derive(Debug, Clone, PartialEq)]
29173#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29174#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29175#[cfg_attr(feature = "ts", derive(TS))]
29176#[cfg_attr(feature = "ts", ts(export))]
29177pub struct SERIAL_CONTROL_DATA {
29178 #[doc = "Baudrate of transfer. Zero means no change."]
29179 pub baudrate: u32,
29180 #[doc = "Timeout for reply data"]
29181 pub timeout: u16,
29182 #[doc = "Serial control device type."]
29183 pub device: SerialControlDev,
29184 #[doc = "Bitmap of serial control flags."]
29185 pub flags: SerialControlFlag,
29186 #[doc = "how many bytes in this transfer"]
29187 pub count: u8,
29188 #[doc = "serial data"]
29189 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29190 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29191 pub data: [u8; 70],
29192 #[doc = "System ID"]
29193 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29194 pub target_system: u8,
29195 #[doc = "Component ID"]
29196 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29197 pub target_component: u8,
29198}
29199impl SERIAL_CONTROL_DATA {
29200 pub const ENCODED_LEN: usize = 81usize;
29201 pub const DEFAULT: Self = Self {
29202 baudrate: 0_u32,
29203 timeout: 0_u16,
29204 device: SerialControlDev::DEFAULT,
29205 flags: SerialControlFlag::DEFAULT,
29206 count: 0_u8,
29207 data: [0_u8; 70usize],
29208 target_system: 0_u8,
29209 target_component: 0_u8,
29210 };
29211 #[cfg(feature = "arbitrary")]
29212 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29213 use arbitrary::{Arbitrary, Unstructured};
29214 let mut buf = [0u8; 1024];
29215 rng.fill_bytes(&mut buf);
29216 let mut unstructured = Unstructured::new(&buf);
29217 Self::arbitrary(&mut unstructured).unwrap_or_default()
29218 }
29219}
29220impl Default for SERIAL_CONTROL_DATA {
29221 fn default() -> Self {
29222 Self::DEFAULT.clone()
29223 }
29224}
29225impl MessageData for SERIAL_CONTROL_DATA {
29226 type Message = MavMessage;
29227 const ID: u32 = 126u32;
29228 const NAME: &'static str = "SERIAL_CONTROL";
29229 const EXTRA_CRC: u8 = 220u8;
29230 const ENCODED_LEN: usize = 81usize;
29231 fn deser(
29232 _version: MavlinkVersion,
29233 __input: &[u8],
29234 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29235 let avail_len = __input.len();
29236 let mut payload_buf = [0; Self::ENCODED_LEN];
29237 let mut buf = if avail_len < Self::ENCODED_LEN {
29238 payload_buf[0..avail_len].copy_from_slice(__input);
29239 Bytes::new(&payload_buf)
29240 } else {
29241 Bytes::new(__input)
29242 };
29243 let mut __struct = Self::default();
29244 __struct.baudrate = buf.get_u32_le();
29245 __struct.timeout = buf.get_u16_le();
29246 let tmp = buf.get_u8();
29247 __struct.device =
29248 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29249 enum_type: "SerialControlDev",
29250 value: tmp as u32,
29251 })?;
29252 let tmp = buf.get_u8();
29253 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
29254 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29255 flag_type: "SerialControlFlag",
29256 value: tmp as u32,
29257 })?;
29258 __struct.count = buf.get_u8();
29259 for v in &mut __struct.data {
29260 let val = buf.get_u8();
29261 *v = val;
29262 }
29263 __struct.target_system = buf.get_u8();
29264 __struct.target_component = buf.get_u8();
29265 Ok(__struct)
29266 }
29267 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29268 let mut __tmp = BytesMut::new(bytes);
29269 #[allow(clippy::absurd_extreme_comparisons)]
29270 #[allow(unused_comparisons)]
29271 if __tmp.remaining() < Self::ENCODED_LEN {
29272 panic!(
29273 "buffer is too small (need {} bytes, but got {})",
29274 Self::ENCODED_LEN,
29275 __tmp.remaining(),
29276 )
29277 }
29278 __tmp.put_u32_le(self.baudrate);
29279 __tmp.put_u16_le(self.timeout);
29280 __tmp.put_u8(self.device as u8);
29281 __tmp.put_u8(self.flags.bits());
29282 __tmp.put_u8(self.count);
29283 for val in &self.data {
29284 __tmp.put_u8(*val);
29285 }
29286 if matches!(version, MavlinkVersion::V2) {
29287 __tmp.put_u8(self.target_system);
29288 __tmp.put_u8(self.target_component);
29289 let len = __tmp.len();
29290 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29291 } else {
29292 __tmp.len()
29293 }
29294 }
29295}
29296#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
29297#[doc = ""]
29298#[doc = "ID: 36"]
29299#[derive(Debug, Clone, PartialEq)]
29300#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29301#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29302#[cfg_attr(feature = "ts", derive(TS))]
29303#[cfg_attr(feature = "ts", ts(export))]
29304pub struct SERVO_OUTPUT_RAW_DATA {
29305 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29306 pub time_usec: u32,
29307 #[doc = "Servo output 1 value"]
29308 pub servo1_raw: u16,
29309 #[doc = "Servo output 2 value"]
29310 pub servo2_raw: u16,
29311 #[doc = "Servo output 3 value"]
29312 pub servo3_raw: u16,
29313 #[doc = "Servo output 4 value"]
29314 pub servo4_raw: u16,
29315 #[doc = "Servo output 5 value"]
29316 pub servo5_raw: u16,
29317 #[doc = "Servo output 6 value"]
29318 pub servo6_raw: u16,
29319 #[doc = "Servo output 7 value"]
29320 pub servo7_raw: u16,
29321 #[doc = "Servo output 8 value"]
29322 pub servo8_raw: u16,
29323 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
29324 pub port: u8,
29325 #[doc = "Servo output 9 value"]
29326 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29327 pub servo9_raw: u16,
29328 #[doc = "Servo output 10 value"]
29329 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29330 pub servo10_raw: u16,
29331 #[doc = "Servo output 11 value"]
29332 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29333 pub servo11_raw: u16,
29334 #[doc = "Servo output 12 value"]
29335 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29336 pub servo12_raw: u16,
29337 #[doc = "Servo output 13 value"]
29338 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29339 pub servo13_raw: u16,
29340 #[doc = "Servo output 14 value"]
29341 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29342 pub servo14_raw: u16,
29343 #[doc = "Servo output 15 value"]
29344 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29345 pub servo15_raw: u16,
29346 #[doc = "Servo output 16 value"]
29347 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29348 pub servo16_raw: u16,
29349}
29350impl SERVO_OUTPUT_RAW_DATA {
29351 pub const ENCODED_LEN: usize = 37usize;
29352 pub const DEFAULT: Self = Self {
29353 time_usec: 0_u32,
29354 servo1_raw: 0_u16,
29355 servo2_raw: 0_u16,
29356 servo3_raw: 0_u16,
29357 servo4_raw: 0_u16,
29358 servo5_raw: 0_u16,
29359 servo6_raw: 0_u16,
29360 servo7_raw: 0_u16,
29361 servo8_raw: 0_u16,
29362 port: 0_u8,
29363 servo9_raw: 0_u16,
29364 servo10_raw: 0_u16,
29365 servo11_raw: 0_u16,
29366 servo12_raw: 0_u16,
29367 servo13_raw: 0_u16,
29368 servo14_raw: 0_u16,
29369 servo15_raw: 0_u16,
29370 servo16_raw: 0_u16,
29371 };
29372 #[cfg(feature = "arbitrary")]
29373 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29374 use arbitrary::{Arbitrary, Unstructured};
29375 let mut buf = [0u8; 1024];
29376 rng.fill_bytes(&mut buf);
29377 let mut unstructured = Unstructured::new(&buf);
29378 Self::arbitrary(&mut unstructured).unwrap_or_default()
29379 }
29380}
29381impl Default for SERVO_OUTPUT_RAW_DATA {
29382 fn default() -> Self {
29383 Self::DEFAULT.clone()
29384 }
29385}
29386impl MessageData for SERVO_OUTPUT_RAW_DATA {
29387 type Message = MavMessage;
29388 const ID: u32 = 36u32;
29389 const NAME: &'static str = "SERVO_OUTPUT_RAW";
29390 const EXTRA_CRC: u8 = 222u8;
29391 const ENCODED_LEN: usize = 37usize;
29392 fn deser(
29393 _version: MavlinkVersion,
29394 __input: &[u8],
29395 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29396 let avail_len = __input.len();
29397 let mut payload_buf = [0; Self::ENCODED_LEN];
29398 let mut buf = if avail_len < Self::ENCODED_LEN {
29399 payload_buf[0..avail_len].copy_from_slice(__input);
29400 Bytes::new(&payload_buf)
29401 } else {
29402 Bytes::new(__input)
29403 };
29404 let mut __struct = Self::default();
29405 __struct.time_usec = buf.get_u32_le();
29406 __struct.servo1_raw = buf.get_u16_le();
29407 __struct.servo2_raw = buf.get_u16_le();
29408 __struct.servo3_raw = buf.get_u16_le();
29409 __struct.servo4_raw = buf.get_u16_le();
29410 __struct.servo5_raw = buf.get_u16_le();
29411 __struct.servo6_raw = buf.get_u16_le();
29412 __struct.servo7_raw = buf.get_u16_le();
29413 __struct.servo8_raw = buf.get_u16_le();
29414 __struct.port = buf.get_u8();
29415 __struct.servo9_raw = buf.get_u16_le();
29416 __struct.servo10_raw = buf.get_u16_le();
29417 __struct.servo11_raw = buf.get_u16_le();
29418 __struct.servo12_raw = buf.get_u16_le();
29419 __struct.servo13_raw = buf.get_u16_le();
29420 __struct.servo14_raw = buf.get_u16_le();
29421 __struct.servo15_raw = buf.get_u16_le();
29422 __struct.servo16_raw = buf.get_u16_le();
29423 Ok(__struct)
29424 }
29425 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29426 let mut __tmp = BytesMut::new(bytes);
29427 #[allow(clippy::absurd_extreme_comparisons)]
29428 #[allow(unused_comparisons)]
29429 if __tmp.remaining() < Self::ENCODED_LEN {
29430 panic!(
29431 "buffer is too small (need {} bytes, but got {})",
29432 Self::ENCODED_LEN,
29433 __tmp.remaining(),
29434 )
29435 }
29436 __tmp.put_u32_le(self.time_usec);
29437 __tmp.put_u16_le(self.servo1_raw);
29438 __tmp.put_u16_le(self.servo2_raw);
29439 __tmp.put_u16_le(self.servo3_raw);
29440 __tmp.put_u16_le(self.servo4_raw);
29441 __tmp.put_u16_le(self.servo5_raw);
29442 __tmp.put_u16_le(self.servo6_raw);
29443 __tmp.put_u16_le(self.servo7_raw);
29444 __tmp.put_u16_le(self.servo8_raw);
29445 __tmp.put_u8(self.port);
29446 if matches!(version, MavlinkVersion::V2) {
29447 __tmp.put_u16_le(self.servo9_raw);
29448 __tmp.put_u16_le(self.servo10_raw);
29449 __tmp.put_u16_le(self.servo11_raw);
29450 __tmp.put_u16_le(self.servo12_raw);
29451 __tmp.put_u16_le(self.servo13_raw);
29452 __tmp.put_u16_le(self.servo14_raw);
29453 __tmp.put_u16_le(self.servo15_raw);
29454 __tmp.put_u16_le(self.servo16_raw);
29455 let len = __tmp.len();
29456 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29457 } else {
29458 __tmp.len()
29459 }
29460 }
29461}
29462#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
29463#[doc = ""]
29464#[doc = "ID: 256"]
29465#[derive(Debug, Clone, PartialEq)]
29466#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29467#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29468#[cfg_attr(feature = "ts", derive(TS))]
29469#[cfg_attr(feature = "ts", ts(export))]
29470pub struct SETUP_SIGNING_DATA {
29471 #[doc = "initial timestamp"]
29472 pub initial_timestamp: u64,
29473 #[doc = "system id of the target"]
29474 pub target_system: u8,
29475 #[doc = "component ID of the target"]
29476 pub target_component: u8,
29477 #[doc = "signing key"]
29478 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29479 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29480 pub secret_key: [u8; 32],
29481}
29482impl SETUP_SIGNING_DATA {
29483 pub const ENCODED_LEN: usize = 42usize;
29484 pub const DEFAULT: Self = Self {
29485 initial_timestamp: 0_u64,
29486 target_system: 0_u8,
29487 target_component: 0_u8,
29488 secret_key: [0_u8; 32usize],
29489 };
29490 #[cfg(feature = "arbitrary")]
29491 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29492 use arbitrary::{Arbitrary, Unstructured};
29493 let mut buf = [0u8; 1024];
29494 rng.fill_bytes(&mut buf);
29495 let mut unstructured = Unstructured::new(&buf);
29496 Self::arbitrary(&mut unstructured).unwrap_or_default()
29497 }
29498}
29499impl Default for SETUP_SIGNING_DATA {
29500 fn default() -> Self {
29501 Self::DEFAULT.clone()
29502 }
29503}
29504impl MessageData for SETUP_SIGNING_DATA {
29505 type Message = MavMessage;
29506 const ID: u32 = 256u32;
29507 const NAME: &'static str = "SETUP_SIGNING";
29508 const EXTRA_CRC: u8 = 71u8;
29509 const ENCODED_LEN: usize = 42usize;
29510 fn deser(
29511 _version: MavlinkVersion,
29512 __input: &[u8],
29513 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29514 let avail_len = __input.len();
29515 let mut payload_buf = [0; Self::ENCODED_LEN];
29516 let mut buf = if avail_len < Self::ENCODED_LEN {
29517 payload_buf[0..avail_len].copy_from_slice(__input);
29518 Bytes::new(&payload_buf)
29519 } else {
29520 Bytes::new(__input)
29521 };
29522 let mut __struct = Self::default();
29523 __struct.initial_timestamp = buf.get_u64_le();
29524 __struct.target_system = buf.get_u8();
29525 __struct.target_component = buf.get_u8();
29526 for v in &mut __struct.secret_key {
29527 let val = buf.get_u8();
29528 *v = val;
29529 }
29530 Ok(__struct)
29531 }
29532 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29533 let mut __tmp = BytesMut::new(bytes);
29534 #[allow(clippy::absurd_extreme_comparisons)]
29535 #[allow(unused_comparisons)]
29536 if __tmp.remaining() < Self::ENCODED_LEN {
29537 panic!(
29538 "buffer is too small (need {} bytes, but got {})",
29539 Self::ENCODED_LEN,
29540 __tmp.remaining(),
29541 )
29542 }
29543 __tmp.put_u64_le(self.initial_timestamp);
29544 __tmp.put_u8(self.target_system);
29545 __tmp.put_u8(self.target_component);
29546 for val in &self.secret_key {
29547 __tmp.put_u8(*val);
29548 }
29549 if matches!(version, MavlinkVersion::V2) {
29550 let len = __tmp.len();
29551 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29552 } else {
29553 __tmp.len()
29554 }
29555 }
29556}
29557#[doc = "Set the vehicle attitude and body angular rates."]
29558#[doc = ""]
29559#[doc = "ID: 139"]
29560#[derive(Debug, Clone, PartialEq)]
29561#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29562#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29563#[cfg_attr(feature = "ts", derive(TS))]
29564#[cfg_attr(feature = "ts", ts(export))]
29565pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
29566 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29567 pub time_usec: u64,
29568 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
29569 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29570 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29571 pub controls: [f32; 8],
29572 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
29573 pub group_mlx: u8,
29574 #[doc = "System ID"]
29575 pub target_system: u8,
29576 #[doc = "Component ID"]
29577 pub target_component: u8,
29578}
29579impl SET_ACTUATOR_CONTROL_TARGET_DATA {
29580 pub const ENCODED_LEN: usize = 43usize;
29581 pub const DEFAULT: Self = Self {
29582 time_usec: 0_u64,
29583 controls: [0.0_f32; 8usize],
29584 group_mlx: 0_u8,
29585 target_system: 0_u8,
29586 target_component: 0_u8,
29587 };
29588 #[cfg(feature = "arbitrary")]
29589 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29590 use arbitrary::{Arbitrary, Unstructured};
29591 let mut buf = [0u8; 1024];
29592 rng.fill_bytes(&mut buf);
29593 let mut unstructured = Unstructured::new(&buf);
29594 Self::arbitrary(&mut unstructured).unwrap_or_default()
29595 }
29596}
29597impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
29598 fn default() -> Self {
29599 Self::DEFAULT.clone()
29600 }
29601}
29602impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
29603 type Message = MavMessage;
29604 const ID: u32 = 139u32;
29605 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
29606 const EXTRA_CRC: u8 = 168u8;
29607 const ENCODED_LEN: usize = 43usize;
29608 fn deser(
29609 _version: MavlinkVersion,
29610 __input: &[u8],
29611 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29612 let avail_len = __input.len();
29613 let mut payload_buf = [0; Self::ENCODED_LEN];
29614 let mut buf = if avail_len < Self::ENCODED_LEN {
29615 payload_buf[0..avail_len].copy_from_slice(__input);
29616 Bytes::new(&payload_buf)
29617 } else {
29618 Bytes::new(__input)
29619 };
29620 let mut __struct = Self::default();
29621 __struct.time_usec = buf.get_u64_le();
29622 for v in &mut __struct.controls {
29623 let val = buf.get_f32_le();
29624 *v = val;
29625 }
29626 __struct.group_mlx = buf.get_u8();
29627 __struct.target_system = buf.get_u8();
29628 __struct.target_component = buf.get_u8();
29629 Ok(__struct)
29630 }
29631 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29632 let mut __tmp = BytesMut::new(bytes);
29633 #[allow(clippy::absurd_extreme_comparisons)]
29634 #[allow(unused_comparisons)]
29635 if __tmp.remaining() < Self::ENCODED_LEN {
29636 panic!(
29637 "buffer is too small (need {} bytes, but got {})",
29638 Self::ENCODED_LEN,
29639 __tmp.remaining(),
29640 )
29641 }
29642 __tmp.put_u64_le(self.time_usec);
29643 for val in &self.controls {
29644 __tmp.put_f32_le(*val);
29645 }
29646 __tmp.put_u8(self.group_mlx);
29647 __tmp.put_u8(self.target_system);
29648 __tmp.put_u8(self.target_component);
29649 if matches!(version, MavlinkVersion::V2) {
29650 let len = __tmp.len();
29651 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29652 } else {
29653 __tmp.len()
29654 }
29655 }
29656}
29657#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
29658#[doc = ""]
29659#[doc = "ID: 82"]
29660#[derive(Debug, Clone, PartialEq)]
29661#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29662#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29663#[cfg_attr(feature = "ts", derive(TS))]
29664#[cfg_attr(feature = "ts", ts(export))]
29665pub struct SET_ATTITUDE_TARGET_DATA {
29666 #[doc = "Timestamp (time since system boot)."]
29667 pub time_boot_ms: u32,
29668 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
29669 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29670 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29671 pub q: [f32; 4],
29672 #[doc = "Body roll rate"]
29673 pub body_roll_rate: f32,
29674 #[doc = "Body pitch rate"]
29675 pub body_pitch_rate: f32,
29676 #[doc = "Body yaw rate"]
29677 pub body_yaw_rate: f32,
29678 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
29679 pub thrust: f32,
29680 #[doc = "System ID"]
29681 pub target_system: u8,
29682 #[doc = "Component ID"]
29683 pub target_component: u8,
29684 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
29685 pub type_mask: AttitudeTargetTypemask,
29686 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
29687 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29688 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29689 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29690 pub thrust_body: [f32; 3],
29691}
29692impl SET_ATTITUDE_TARGET_DATA {
29693 pub const ENCODED_LEN: usize = 51usize;
29694 pub const DEFAULT: Self = Self {
29695 time_boot_ms: 0_u32,
29696 q: [0.0_f32; 4usize],
29697 body_roll_rate: 0.0_f32,
29698 body_pitch_rate: 0.0_f32,
29699 body_yaw_rate: 0.0_f32,
29700 thrust: 0.0_f32,
29701 target_system: 0_u8,
29702 target_component: 0_u8,
29703 type_mask: AttitudeTargetTypemask::DEFAULT,
29704 thrust_body: [0.0_f32; 3usize],
29705 };
29706 #[cfg(feature = "arbitrary")]
29707 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29708 use arbitrary::{Arbitrary, Unstructured};
29709 let mut buf = [0u8; 1024];
29710 rng.fill_bytes(&mut buf);
29711 let mut unstructured = Unstructured::new(&buf);
29712 Self::arbitrary(&mut unstructured).unwrap_or_default()
29713 }
29714}
29715impl Default for SET_ATTITUDE_TARGET_DATA {
29716 fn default() -> Self {
29717 Self::DEFAULT.clone()
29718 }
29719}
29720impl MessageData for SET_ATTITUDE_TARGET_DATA {
29721 type Message = MavMessage;
29722 const ID: u32 = 82u32;
29723 const NAME: &'static str = "SET_ATTITUDE_TARGET";
29724 const EXTRA_CRC: u8 = 49u8;
29725 const ENCODED_LEN: usize = 51usize;
29726 fn deser(
29727 _version: MavlinkVersion,
29728 __input: &[u8],
29729 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29730 let avail_len = __input.len();
29731 let mut payload_buf = [0; Self::ENCODED_LEN];
29732 let mut buf = if avail_len < Self::ENCODED_LEN {
29733 payload_buf[0..avail_len].copy_from_slice(__input);
29734 Bytes::new(&payload_buf)
29735 } else {
29736 Bytes::new(__input)
29737 };
29738 let mut __struct = Self::default();
29739 __struct.time_boot_ms = buf.get_u32_le();
29740 for v in &mut __struct.q {
29741 let val = buf.get_f32_le();
29742 *v = val;
29743 }
29744 __struct.body_roll_rate = buf.get_f32_le();
29745 __struct.body_pitch_rate = buf.get_f32_le();
29746 __struct.body_yaw_rate = buf.get_f32_le();
29747 __struct.thrust = buf.get_f32_le();
29748 __struct.target_system = buf.get_u8();
29749 __struct.target_component = buf.get_u8();
29750 let tmp = buf.get_u8();
29751 __struct.type_mask = AttitudeTargetTypemask::from_bits(
29752 tmp & AttitudeTargetTypemask::all().bits(),
29753 )
29754 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29755 flag_type: "AttitudeTargetTypemask",
29756 value: tmp as u32,
29757 })?;
29758 for v in &mut __struct.thrust_body {
29759 let val = buf.get_f32_le();
29760 *v = val;
29761 }
29762 Ok(__struct)
29763 }
29764 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29765 let mut __tmp = BytesMut::new(bytes);
29766 #[allow(clippy::absurd_extreme_comparisons)]
29767 #[allow(unused_comparisons)]
29768 if __tmp.remaining() < Self::ENCODED_LEN {
29769 panic!(
29770 "buffer is too small (need {} bytes, but got {})",
29771 Self::ENCODED_LEN,
29772 __tmp.remaining(),
29773 )
29774 }
29775 __tmp.put_u32_le(self.time_boot_ms);
29776 for val in &self.q {
29777 __tmp.put_f32_le(*val);
29778 }
29779 __tmp.put_f32_le(self.body_roll_rate);
29780 __tmp.put_f32_le(self.body_pitch_rate);
29781 __tmp.put_f32_le(self.body_yaw_rate);
29782 __tmp.put_f32_le(self.thrust);
29783 __tmp.put_u8(self.target_system);
29784 __tmp.put_u8(self.target_component);
29785 __tmp.put_u8(self.type_mask.bits());
29786 if matches!(version, MavlinkVersion::V2) {
29787 for val in &self.thrust_body {
29788 __tmp.put_f32_le(*val);
29789 }
29790 let len = __tmp.len();
29791 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29792 } else {
29793 __tmp.len()
29794 }
29795 }
29796}
29797#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
29798#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
29799#[doc = ""]
29800#[doc = "ID: 48"]
29801#[derive(Debug, Clone, PartialEq)]
29802#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29803#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29804#[cfg_attr(feature = "ts", derive(TS))]
29805#[cfg_attr(feature = "ts", ts(export))]
29806pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
29807 #[doc = "Latitude (WGS84)"]
29808 pub latitude: i32,
29809 #[doc = "Longitude (WGS84)"]
29810 pub longitude: i32,
29811 #[doc = "Altitude (MSL). Positive for up."]
29812 pub altitude: i32,
29813 #[doc = "System ID"]
29814 pub target_system: u8,
29815 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29816 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29817 pub time_usec: u64,
29818}
29819impl SET_GPS_GLOBAL_ORIGIN_DATA {
29820 pub const ENCODED_LEN: usize = 21usize;
29821 pub const DEFAULT: Self = Self {
29822 latitude: 0_i32,
29823 longitude: 0_i32,
29824 altitude: 0_i32,
29825 target_system: 0_u8,
29826 time_usec: 0_u64,
29827 };
29828 #[cfg(feature = "arbitrary")]
29829 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29830 use arbitrary::{Arbitrary, Unstructured};
29831 let mut buf = [0u8; 1024];
29832 rng.fill_bytes(&mut buf);
29833 let mut unstructured = Unstructured::new(&buf);
29834 Self::arbitrary(&mut unstructured).unwrap_or_default()
29835 }
29836}
29837impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
29838 fn default() -> Self {
29839 Self::DEFAULT.clone()
29840 }
29841}
29842impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
29843 type Message = MavMessage;
29844 const ID: u32 = 48u32;
29845 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
29846 const EXTRA_CRC: u8 = 41u8;
29847 const ENCODED_LEN: usize = 21usize;
29848 fn deser(
29849 _version: MavlinkVersion,
29850 __input: &[u8],
29851 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29852 let avail_len = __input.len();
29853 let mut payload_buf = [0; Self::ENCODED_LEN];
29854 let mut buf = if avail_len < Self::ENCODED_LEN {
29855 payload_buf[0..avail_len].copy_from_slice(__input);
29856 Bytes::new(&payload_buf)
29857 } else {
29858 Bytes::new(__input)
29859 };
29860 let mut __struct = Self::default();
29861 __struct.latitude = buf.get_i32_le();
29862 __struct.longitude = buf.get_i32_le();
29863 __struct.altitude = buf.get_i32_le();
29864 __struct.target_system = buf.get_u8();
29865 __struct.time_usec = buf.get_u64_le();
29866 Ok(__struct)
29867 }
29868 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29869 let mut __tmp = BytesMut::new(bytes);
29870 #[allow(clippy::absurd_extreme_comparisons)]
29871 #[allow(unused_comparisons)]
29872 if __tmp.remaining() < Self::ENCODED_LEN {
29873 panic!(
29874 "buffer is too small (need {} bytes, but got {})",
29875 Self::ENCODED_LEN,
29876 __tmp.remaining(),
29877 )
29878 }
29879 __tmp.put_i32_le(self.latitude);
29880 __tmp.put_i32_le(self.longitude);
29881 __tmp.put_i32_le(self.altitude);
29882 __tmp.put_u8(self.target_system);
29883 if matches!(version, MavlinkVersion::V2) {
29884 __tmp.put_u64_le(self.time_usec);
29885 let len = __tmp.len();
29886 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29887 } else {
29888 __tmp.len()
29889 }
29890 }
29891}
29892#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
29893#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
29894#[doc = ""]
29895#[doc = "ID: 243"]
29896#[derive(Debug, Clone, PartialEq)]
29897#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29898#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29899#[cfg_attr(feature = "ts", derive(TS))]
29900#[cfg_attr(feature = "ts", ts(export))]
29901pub struct SET_HOME_POSITION_DATA {
29902 #[doc = "Latitude (WGS84)"]
29903 pub latitude: i32,
29904 #[doc = "Longitude (WGS84)"]
29905 pub longitude: i32,
29906 #[doc = "Altitude (MSL). Positive for up."]
29907 pub altitude: i32,
29908 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
29909 pub x: f32,
29910 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
29911 pub y: f32,
29912 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
29913 pub z: f32,
29914 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
29915 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29916 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29917 pub q: [f32; 4],
29918 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
29919 pub approach_x: f32,
29920 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
29921 pub approach_y: f32,
29922 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
29923 pub approach_z: f32,
29924 #[doc = "System ID."]
29925 pub target_system: u8,
29926 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29927 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29928 pub time_usec: u64,
29929}
29930impl SET_HOME_POSITION_DATA {
29931 pub const ENCODED_LEN: usize = 61usize;
29932 pub const DEFAULT: Self = Self {
29933 latitude: 0_i32,
29934 longitude: 0_i32,
29935 altitude: 0_i32,
29936 x: 0.0_f32,
29937 y: 0.0_f32,
29938 z: 0.0_f32,
29939 q: [0.0_f32; 4usize],
29940 approach_x: 0.0_f32,
29941 approach_y: 0.0_f32,
29942 approach_z: 0.0_f32,
29943 target_system: 0_u8,
29944 time_usec: 0_u64,
29945 };
29946 #[cfg(feature = "arbitrary")]
29947 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29948 use arbitrary::{Arbitrary, Unstructured};
29949 let mut buf = [0u8; 1024];
29950 rng.fill_bytes(&mut buf);
29951 let mut unstructured = Unstructured::new(&buf);
29952 Self::arbitrary(&mut unstructured).unwrap_or_default()
29953 }
29954}
29955impl Default for SET_HOME_POSITION_DATA {
29956 fn default() -> Self {
29957 Self::DEFAULT.clone()
29958 }
29959}
29960impl MessageData for SET_HOME_POSITION_DATA {
29961 type Message = MavMessage;
29962 const ID: u32 = 243u32;
29963 const NAME: &'static str = "SET_HOME_POSITION";
29964 const EXTRA_CRC: u8 = 85u8;
29965 const ENCODED_LEN: usize = 61usize;
29966 fn deser(
29967 _version: MavlinkVersion,
29968 __input: &[u8],
29969 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29970 let avail_len = __input.len();
29971 let mut payload_buf = [0; Self::ENCODED_LEN];
29972 let mut buf = if avail_len < Self::ENCODED_LEN {
29973 payload_buf[0..avail_len].copy_from_slice(__input);
29974 Bytes::new(&payload_buf)
29975 } else {
29976 Bytes::new(__input)
29977 };
29978 let mut __struct = Self::default();
29979 __struct.latitude = buf.get_i32_le();
29980 __struct.longitude = buf.get_i32_le();
29981 __struct.altitude = buf.get_i32_le();
29982 __struct.x = buf.get_f32_le();
29983 __struct.y = buf.get_f32_le();
29984 __struct.z = buf.get_f32_le();
29985 for v in &mut __struct.q {
29986 let val = buf.get_f32_le();
29987 *v = val;
29988 }
29989 __struct.approach_x = buf.get_f32_le();
29990 __struct.approach_y = buf.get_f32_le();
29991 __struct.approach_z = buf.get_f32_le();
29992 __struct.target_system = buf.get_u8();
29993 __struct.time_usec = buf.get_u64_le();
29994 Ok(__struct)
29995 }
29996 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29997 let mut __tmp = BytesMut::new(bytes);
29998 #[allow(clippy::absurd_extreme_comparisons)]
29999 #[allow(unused_comparisons)]
30000 if __tmp.remaining() < Self::ENCODED_LEN {
30001 panic!(
30002 "buffer is too small (need {} bytes, but got {})",
30003 Self::ENCODED_LEN,
30004 __tmp.remaining(),
30005 )
30006 }
30007 __tmp.put_i32_le(self.latitude);
30008 __tmp.put_i32_le(self.longitude);
30009 __tmp.put_i32_le(self.altitude);
30010 __tmp.put_f32_le(self.x);
30011 __tmp.put_f32_le(self.y);
30012 __tmp.put_f32_le(self.z);
30013 for val in &self.q {
30014 __tmp.put_f32_le(*val);
30015 }
30016 __tmp.put_f32_le(self.approach_x);
30017 __tmp.put_f32_le(self.approach_y);
30018 __tmp.put_f32_le(self.approach_z);
30019 __tmp.put_u8(self.target_system);
30020 if matches!(version, MavlinkVersion::V2) {
30021 __tmp.put_u64_le(self.time_usec);
30022 let len = __tmp.len();
30023 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30024 } else {
30025 __tmp.len()
30026 }
30027 }
30028}
30029#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
30030#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
30031#[doc = ""]
30032#[doc = "ID: 11"]
30033#[derive(Debug, Clone, PartialEq)]
30034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30035#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30036#[cfg_attr(feature = "ts", derive(TS))]
30037#[cfg_attr(feature = "ts", ts(export))]
30038pub struct SET_MODE_DATA {
30039 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
30040 pub custom_mode: u32,
30041 #[doc = "The system setting the mode"]
30042 pub target_system: u8,
30043 #[doc = "The new base mode."]
30044 pub base_mode: MavMode,
30045}
30046impl SET_MODE_DATA {
30047 pub const ENCODED_LEN: usize = 6usize;
30048 pub const DEFAULT: Self = Self {
30049 custom_mode: 0_u32,
30050 target_system: 0_u8,
30051 base_mode: MavMode::DEFAULT,
30052 };
30053 #[cfg(feature = "arbitrary")]
30054 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30055 use arbitrary::{Arbitrary, Unstructured};
30056 let mut buf = [0u8; 1024];
30057 rng.fill_bytes(&mut buf);
30058 let mut unstructured = Unstructured::new(&buf);
30059 Self::arbitrary(&mut unstructured).unwrap_or_default()
30060 }
30061}
30062impl Default for SET_MODE_DATA {
30063 fn default() -> Self {
30064 Self::DEFAULT.clone()
30065 }
30066}
30067impl MessageData for SET_MODE_DATA {
30068 type Message = MavMessage;
30069 const ID: u32 = 11u32;
30070 const NAME: &'static str = "SET_MODE";
30071 const EXTRA_CRC: u8 = 89u8;
30072 const ENCODED_LEN: usize = 6usize;
30073 fn deser(
30074 _version: MavlinkVersion,
30075 __input: &[u8],
30076 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30077 let avail_len = __input.len();
30078 let mut payload_buf = [0; Self::ENCODED_LEN];
30079 let mut buf = if avail_len < Self::ENCODED_LEN {
30080 payload_buf[0..avail_len].copy_from_slice(__input);
30081 Bytes::new(&payload_buf)
30082 } else {
30083 Bytes::new(__input)
30084 };
30085 let mut __struct = Self::default();
30086 __struct.custom_mode = buf.get_u32_le();
30087 __struct.target_system = buf.get_u8();
30088 let tmp = buf.get_u8();
30089 __struct.base_mode =
30090 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30091 enum_type: "MavMode",
30092 value: tmp as u32,
30093 })?;
30094 Ok(__struct)
30095 }
30096 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30097 let mut __tmp = BytesMut::new(bytes);
30098 #[allow(clippy::absurd_extreme_comparisons)]
30099 #[allow(unused_comparisons)]
30100 if __tmp.remaining() < Self::ENCODED_LEN {
30101 panic!(
30102 "buffer is too small (need {} bytes, but got {})",
30103 Self::ENCODED_LEN,
30104 __tmp.remaining(),
30105 )
30106 }
30107 __tmp.put_u32_le(self.custom_mode);
30108 __tmp.put_u8(self.target_system);
30109 __tmp.put_u8(self.base_mode as u8);
30110 if matches!(version, MavlinkVersion::V2) {
30111 let len = __tmp.len();
30112 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30113 } else {
30114 __tmp.len()
30115 }
30116 }
30117}
30118#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
30119#[doc = ""]
30120#[doc = "ID: 86"]
30121#[derive(Debug, Clone, PartialEq)]
30122#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30123#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30124#[cfg_attr(feature = "ts", derive(TS))]
30125#[cfg_attr(feature = "ts", ts(export))]
30126pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
30127 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
30128 pub time_boot_ms: u32,
30129 #[doc = "Latitude in WGS84 frame"]
30130 pub lat_int: i32,
30131 #[doc = "Longitude in WGS84 frame"]
30132 pub lon_int: i32,
30133 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
30134 pub alt: f32,
30135 #[doc = "X velocity in NED frame"]
30136 pub vx: f32,
30137 #[doc = "Y velocity in NED frame"]
30138 pub vy: f32,
30139 #[doc = "Z velocity in NED frame"]
30140 pub vz: f32,
30141 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
30142 pub afx: f32,
30143 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
30144 pub afy: f32,
30145 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
30146 pub afz: f32,
30147 #[doc = "yaw setpoint"]
30148 pub yaw: f32,
30149 #[doc = "yaw rate setpoint"]
30150 pub yaw_rate: f32,
30151 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
30152 pub type_mask: PositionTargetTypemask,
30153 #[doc = "System ID"]
30154 pub target_system: u8,
30155 #[doc = "Component ID"]
30156 pub target_component: u8,
30157 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
30158 pub coordinate_frame: MavFrame,
30159}
30160impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
30161 pub const ENCODED_LEN: usize = 53usize;
30162 pub const DEFAULT: Self = Self {
30163 time_boot_ms: 0_u32,
30164 lat_int: 0_i32,
30165 lon_int: 0_i32,
30166 alt: 0.0_f32,
30167 vx: 0.0_f32,
30168 vy: 0.0_f32,
30169 vz: 0.0_f32,
30170 afx: 0.0_f32,
30171 afy: 0.0_f32,
30172 afz: 0.0_f32,
30173 yaw: 0.0_f32,
30174 yaw_rate: 0.0_f32,
30175 type_mask: PositionTargetTypemask::DEFAULT,
30176 target_system: 0_u8,
30177 target_component: 0_u8,
30178 coordinate_frame: MavFrame::DEFAULT,
30179 };
30180 #[cfg(feature = "arbitrary")]
30181 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30182 use arbitrary::{Arbitrary, Unstructured};
30183 let mut buf = [0u8; 1024];
30184 rng.fill_bytes(&mut buf);
30185 let mut unstructured = Unstructured::new(&buf);
30186 Self::arbitrary(&mut unstructured).unwrap_or_default()
30187 }
30188}
30189impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
30190 fn default() -> Self {
30191 Self::DEFAULT.clone()
30192 }
30193}
30194impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
30195 type Message = MavMessage;
30196 const ID: u32 = 86u32;
30197 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
30198 const EXTRA_CRC: u8 = 5u8;
30199 const ENCODED_LEN: usize = 53usize;
30200 fn deser(
30201 _version: MavlinkVersion,
30202 __input: &[u8],
30203 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30204 let avail_len = __input.len();
30205 let mut payload_buf = [0; Self::ENCODED_LEN];
30206 let mut buf = if avail_len < Self::ENCODED_LEN {
30207 payload_buf[0..avail_len].copy_from_slice(__input);
30208 Bytes::new(&payload_buf)
30209 } else {
30210 Bytes::new(__input)
30211 };
30212 let mut __struct = Self::default();
30213 __struct.time_boot_ms = buf.get_u32_le();
30214 __struct.lat_int = buf.get_i32_le();
30215 __struct.lon_int = buf.get_i32_le();
30216 __struct.alt = buf.get_f32_le();
30217 __struct.vx = buf.get_f32_le();
30218 __struct.vy = buf.get_f32_le();
30219 __struct.vz = buf.get_f32_le();
30220 __struct.afx = buf.get_f32_le();
30221 __struct.afy = buf.get_f32_le();
30222 __struct.afz = buf.get_f32_le();
30223 __struct.yaw = buf.get_f32_le();
30224 __struct.yaw_rate = buf.get_f32_le();
30225 let tmp = buf.get_u16_le();
30226 __struct.type_mask = PositionTargetTypemask::from_bits(
30227 tmp & PositionTargetTypemask::all().bits(),
30228 )
30229 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30230 flag_type: "PositionTargetTypemask",
30231 value: tmp as u32,
30232 })?;
30233 __struct.target_system = buf.get_u8();
30234 __struct.target_component = buf.get_u8();
30235 let tmp = buf.get_u8();
30236 __struct.coordinate_frame =
30237 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30238 enum_type: "MavFrame",
30239 value: tmp as u32,
30240 })?;
30241 Ok(__struct)
30242 }
30243 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30244 let mut __tmp = BytesMut::new(bytes);
30245 #[allow(clippy::absurd_extreme_comparisons)]
30246 #[allow(unused_comparisons)]
30247 if __tmp.remaining() < Self::ENCODED_LEN {
30248 panic!(
30249 "buffer is too small (need {} bytes, but got {})",
30250 Self::ENCODED_LEN,
30251 __tmp.remaining(),
30252 )
30253 }
30254 __tmp.put_u32_le(self.time_boot_ms);
30255 __tmp.put_i32_le(self.lat_int);
30256 __tmp.put_i32_le(self.lon_int);
30257 __tmp.put_f32_le(self.alt);
30258 __tmp.put_f32_le(self.vx);
30259 __tmp.put_f32_le(self.vy);
30260 __tmp.put_f32_le(self.vz);
30261 __tmp.put_f32_le(self.afx);
30262 __tmp.put_f32_le(self.afy);
30263 __tmp.put_f32_le(self.afz);
30264 __tmp.put_f32_le(self.yaw);
30265 __tmp.put_f32_le(self.yaw_rate);
30266 __tmp.put_u16_le(self.type_mask.bits());
30267 __tmp.put_u8(self.target_system);
30268 __tmp.put_u8(self.target_component);
30269 __tmp.put_u8(self.coordinate_frame as u8);
30270 if matches!(version, MavlinkVersion::V2) {
30271 let len = __tmp.len();
30272 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30273 } else {
30274 __tmp.len()
30275 }
30276 }
30277}
30278#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
30279#[doc = ""]
30280#[doc = "ID: 84"]
30281#[derive(Debug, Clone, PartialEq)]
30282#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30283#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30284#[cfg_attr(feature = "ts", derive(TS))]
30285#[cfg_attr(feature = "ts", ts(export))]
30286pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
30287 #[doc = "Timestamp (time since system boot)."]
30288 pub time_boot_ms: u32,
30289 #[doc = "X Position in NED frame"]
30290 pub x: f32,
30291 #[doc = "Y Position in NED frame"]
30292 pub y: f32,
30293 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
30294 pub z: f32,
30295 #[doc = "X velocity in NED frame"]
30296 pub vx: f32,
30297 #[doc = "Y velocity in NED frame"]
30298 pub vy: f32,
30299 #[doc = "Z velocity in NED frame"]
30300 pub vz: f32,
30301 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
30302 pub afx: f32,
30303 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
30304 pub afy: f32,
30305 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
30306 pub afz: f32,
30307 #[doc = "yaw setpoint"]
30308 pub yaw: f32,
30309 #[doc = "yaw rate setpoint"]
30310 pub yaw_rate: f32,
30311 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
30312 pub type_mask: PositionTargetTypemask,
30313 #[doc = "System ID"]
30314 pub target_system: u8,
30315 #[doc = "Component ID"]
30316 pub target_component: u8,
30317 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
30318 pub coordinate_frame: MavFrame,
30319}
30320impl SET_POSITION_TARGET_LOCAL_NED_DATA {
30321 pub const ENCODED_LEN: usize = 53usize;
30322 pub const DEFAULT: Self = Self {
30323 time_boot_ms: 0_u32,
30324 x: 0.0_f32,
30325 y: 0.0_f32,
30326 z: 0.0_f32,
30327 vx: 0.0_f32,
30328 vy: 0.0_f32,
30329 vz: 0.0_f32,
30330 afx: 0.0_f32,
30331 afy: 0.0_f32,
30332 afz: 0.0_f32,
30333 yaw: 0.0_f32,
30334 yaw_rate: 0.0_f32,
30335 type_mask: PositionTargetTypemask::DEFAULT,
30336 target_system: 0_u8,
30337 target_component: 0_u8,
30338 coordinate_frame: MavFrame::DEFAULT,
30339 };
30340 #[cfg(feature = "arbitrary")]
30341 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30342 use arbitrary::{Arbitrary, Unstructured};
30343 let mut buf = [0u8; 1024];
30344 rng.fill_bytes(&mut buf);
30345 let mut unstructured = Unstructured::new(&buf);
30346 Self::arbitrary(&mut unstructured).unwrap_or_default()
30347 }
30348}
30349impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
30350 fn default() -> Self {
30351 Self::DEFAULT.clone()
30352 }
30353}
30354impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
30355 type Message = MavMessage;
30356 const ID: u32 = 84u32;
30357 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
30358 const EXTRA_CRC: u8 = 143u8;
30359 const ENCODED_LEN: usize = 53usize;
30360 fn deser(
30361 _version: MavlinkVersion,
30362 __input: &[u8],
30363 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30364 let avail_len = __input.len();
30365 let mut payload_buf = [0; Self::ENCODED_LEN];
30366 let mut buf = if avail_len < Self::ENCODED_LEN {
30367 payload_buf[0..avail_len].copy_from_slice(__input);
30368 Bytes::new(&payload_buf)
30369 } else {
30370 Bytes::new(__input)
30371 };
30372 let mut __struct = Self::default();
30373 __struct.time_boot_ms = buf.get_u32_le();
30374 __struct.x = buf.get_f32_le();
30375 __struct.y = buf.get_f32_le();
30376 __struct.z = buf.get_f32_le();
30377 __struct.vx = buf.get_f32_le();
30378 __struct.vy = buf.get_f32_le();
30379 __struct.vz = buf.get_f32_le();
30380 __struct.afx = buf.get_f32_le();
30381 __struct.afy = buf.get_f32_le();
30382 __struct.afz = buf.get_f32_le();
30383 __struct.yaw = buf.get_f32_le();
30384 __struct.yaw_rate = buf.get_f32_le();
30385 let tmp = buf.get_u16_le();
30386 __struct.type_mask = PositionTargetTypemask::from_bits(
30387 tmp & PositionTargetTypemask::all().bits(),
30388 )
30389 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30390 flag_type: "PositionTargetTypemask",
30391 value: tmp as u32,
30392 })?;
30393 __struct.target_system = buf.get_u8();
30394 __struct.target_component = buf.get_u8();
30395 let tmp = buf.get_u8();
30396 __struct.coordinate_frame =
30397 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30398 enum_type: "MavFrame",
30399 value: tmp as u32,
30400 })?;
30401 Ok(__struct)
30402 }
30403 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30404 let mut __tmp = BytesMut::new(bytes);
30405 #[allow(clippy::absurd_extreme_comparisons)]
30406 #[allow(unused_comparisons)]
30407 if __tmp.remaining() < Self::ENCODED_LEN {
30408 panic!(
30409 "buffer is too small (need {} bytes, but got {})",
30410 Self::ENCODED_LEN,
30411 __tmp.remaining(),
30412 )
30413 }
30414 __tmp.put_u32_le(self.time_boot_ms);
30415 __tmp.put_f32_le(self.x);
30416 __tmp.put_f32_le(self.y);
30417 __tmp.put_f32_le(self.z);
30418 __tmp.put_f32_le(self.vx);
30419 __tmp.put_f32_le(self.vy);
30420 __tmp.put_f32_le(self.vz);
30421 __tmp.put_f32_le(self.afx);
30422 __tmp.put_f32_le(self.afy);
30423 __tmp.put_f32_le(self.afz);
30424 __tmp.put_f32_le(self.yaw);
30425 __tmp.put_f32_le(self.yaw_rate);
30426 __tmp.put_u16_le(self.type_mask.bits());
30427 __tmp.put_u8(self.target_system);
30428 __tmp.put_u8(self.target_component);
30429 __tmp.put_u8(self.coordinate_frame as u8);
30430 if matches!(version, MavlinkVersion::V2) {
30431 let len = __tmp.len();
30432 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30433 } else {
30434 __tmp.len()
30435 }
30436 }
30437}
30438#[doc = "Status of simulation environment, if used."]
30439#[doc = ""]
30440#[doc = "ID: 108"]
30441#[derive(Debug, Clone, PartialEq)]
30442#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30443#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30444#[cfg_attr(feature = "ts", derive(TS))]
30445#[cfg_attr(feature = "ts", ts(export))]
30446pub struct SIM_STATE_DATA {
30447 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
30448 pub q1: f32,
30449 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
30450 pub q2: f32,
30451 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
30452 pub q3: f32,
30453 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
30454 pub q4: f32,
30455 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
30456 pub roll: f32,
30457 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
30458 pub pitch: f32,
30459 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
30460 pub yaw: f32,
30461 #[doc = "X acceleration"]
30462 pub xacc: f32,
30463 #[doc = "Y acceleration"]
30464 pub yacc: f32,
30465 #[doc = "Z acceleration"]
30466 pub zacc: f32,
30467 #[doc = "Angular speed around X axis"]
30468 pub xgyro: f32,
30469 #[doc = "Angular speed around Y axis"]
30470 pub ygyro: f32,
30471 #[doc = "Angular speed around Z axis"]
30472 pub zgyro: f32,
30473 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
30474 pub lat: f32,
30475 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
30476 pub lon: f32,
30477 #[doc = "Altitude"]
30478 pub alt: f32,
30479 #[doc = "Horizontal position standard deviation"]
30480 pub std_dev_horz: f32,
30481 #[doc = "Vertical position standard deviation"]
30482 pub std_dev_vert: f32,
30483 #[doc = "True velocity in north direction in earth-fixed NED frame"]
30484 pub vn: f32,
30485 #[doc = "True velocity in east direction in earth-fixed NED frame"]
30486 pub ve: f32,
30487 #[doc = "True velocity in down direction in earth-fixed NED frame"]
30488 pub vd: f32,
30489 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
30490 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30491 pub lat_int: i32,
30492 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
30493 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30494 pub lon_int: i32,
30495}
30496impl SIM_STATE_DATA {
30497 pub const ENCODED_LEN: usize = 92usize;
30498 pub const DEFAULT: Self = Self {
30499 q1: 0.0_f32,
30500 q2: 0.0_f32,
30501 q3: 0.0_f32,
30502 q4: 0.0_f32,
30503 roll: 0.0_f32,
30504 pitch: 0.0_f32,
30505 yaw: 0.0_f32,
30506 xacc: 0.0_f32,
30507 yacc: 0.0_f32,
30508 zacc: 0.0_f32,
30509 xgyro: 0.0_f32,
30510 ygyro: 0.0_f32,
30511 zgyro: 0.0_f32,
30512 lat: 0.0_f32,
30513 lon: 0.0_f32,
30514 alt: 0.0_f32,
30515 std_dev_horz: 0.0_f32,
30516 std_dev_vert: 0.0_f32,
30517 vn: 0.0_f32,
30518 ve: 0.0_f32,
30519 vd: 0.0_f32,
30520 lat_int: 0_i32,
30521 lon_int: 0_i32,
30522 };
30523 #[cfg(feature = "arbitrary")]
30524 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30525 use arbitrary::{Arbitrary, Unstructured};
30526 let mut buf = [0u8; 1024];
30527 rng.fill_bytes(&mut buf);
30528 let mut unstructured = Unstructured::new(&buf);
30529 Self::arbitrary(&mut unstructured).unwrap_or_default()
30530 }
30531}
30532impl Default for SIM_STATE_DATA {
30533 fn default() -> Self {
30534 Self::DEFAULT.clone()
30535 }
30536}
30537impl MessageData for SIM_STATE_DATA {
30538 type Message = MavMessage;
30539 const ID: u32 = 108u32;
30540 const NAME: &'static str = "SIM_STATE";
30541 const EXTRA_CRC: u8 = 32u8;
30542 const ENCODED_LEN: usize = 92usize;
30543 fn deser(
30544 _version: MavlinkVersion,
30545 __input: &[u8],
30546 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30547 let avail_len = __input.len();
30548 let mut payload_buf = [0; Self::ENCODED_LEN];
30549 let mut buf = if avail_len < Self::ENCODED_LEN {
30550 payload_buf[0..avail_len].copy_from_slice(__input);
30551 Bytes::new(&payload_buf)
30552 } else {
30553 Bytes::new(__input)
30554 };
30555 let mut __struct = Self::default();
30556 __struct.q1 = buf.get_f32_le();
30557 __struct.q2 = buf.get_f32_le();
30558 __struct.q3 = buf.get_f32_le();
30559 __struct.q4 = buf.get_f32_le();
30560 __struct.roll = buf.get_f32_le();
30561 __struct.pitch = buf.get_f32_le();
30562 __struct.yaw = buf.get_f32_le();
30563 __struct.xacc = buf.get_f32_le();
30564 __struct.yacc = buf.get_f32_le();
30565 __struct.zacc = buf.get_f32_le();
30566 __struct.xgyro = buf.get_f32_le();
30567 __struct.ygyro = buf.get_f32_le();
30568 __struct.zgyro = buf.get_f32_le();
30569 __struct.lat = buf.get_f32_le();
30570 __struct.lon = buf.get_f32_le();
30571 __struct.alt = buf.get_f32_le();
30572 __struct.std_dev_horz = buf.get_f32_le();
30573 __struct.std_dev_vert = buf.get_f32_le();
30574 __struct.vn = buf.get_f32_le();
30575 __struct.ve = buf.get_f32_le();
30576 __struct.vd = buf.get_f32_le();
30577 __struct.lat_int = buf.get_i32_le();
30578 __struct.lon_int = buf.get_i32_le();
30579 Ok(__struct)
30580 }
30581 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30582 let mut __tmp = BytesMut::new(bytes);
30583 #[allow(clippy::absurd_extreme_comparisons)]
30584 #[allow(unused_comparisons)]
30585 if __tmp.remaining() < Self::ENCODED_LEN {
30586 panic!(
30587 "buffer is too small (need {} bytes, but got {})",
30588 Self::ENCODED_LEN,
30589 __tmp.remaining(),
30590 )
30591 }
30592 __tmp.put_f32_le(self.q1);
30593 __tmp.put_f32_le(self.q2);
30594 __tmp.put_f32_le(self.q3);
30595 __tmp.put_f32_le(self.q4);
30596 __tmp.put_f32_le(self.roll);
30597 __tmp.put_f32_le(self.pitch);
30598 __tmp.put_f32_le(self.yaw);
30599 __tmp.put_f32_le(self.xacc);
30600 __tmp.put_f32_le(self.yacc);
30601 __tmp.put_f32_le(self.zacc);
30602 __tmp.put_f32_le(self.xgyro);
30603 __tmp.put_f32_le(self.ygyro);
30604 __tmp.put_f32_le(self.zgyro);
30605 __tmp.put_f32_le(self.lat);
30606 __tmp.put_f32_le(self.lon);
30607 __tmp.put_f32_le(self.alt);
30608 __tmp.put_f32_le(self.std_dev_horz);
30609 __tmp.put_f32_le(self.std_dev_vert);
30610 __tmp.put_f32_le(self.vn);
30611 __tmp.put_f32_le(self.ve);
30612 __tmp.put_f32_le(self.vd);
30613 if matches!(version, MavlinkVersion::V2) {
30614 __tmp.put_i32_le(self.lat_int);
30615 __tmp.put_i32_le(self.lon_int);
30616 let len = __tmp.len();
30617 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30618 } else {
30619 __tmp.len()
30620 }
30621 }
30622}
30623#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
30624#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
30625#[doc = ""]
30626#[doc = "ID: 370"]
30627#[derive(Debug, Clone, PartialEq)]
30628#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30629#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30630#[cfg_attr(feature = "ts", derive(TS))]
30631#[cfg_attr(feature = "ts", ts(export))]
30632pub struct SMART_BATTERY_INFO_DATA {
30633 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
30634 pub capacity_full_specification: i32,
30635 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
30636 pub capacity_full: i32,
30637 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
30638 pub cycle_count: u16,
30639 #[doc = "Battery weight. 0: field not provided."]
30640 pub weight: u16,
30641 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
30642 pub discharge_minimum_voltage: u16,
30643 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
30644 pub charging_minimum_voltage: u16,
30645 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
30646 pub resting_minimum_voltage: u16,
30647 #[doc = "Battery ID"]
30648 pub id: u8,
30649 #[doc = "Function of the battery"]
30650 pub battery_function: MavBatteryFunction,
30651 #[doc = "Type (chemistry) of the battery"]
30652 pub mavtype: MavBatteryType,
30653 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
30654 #[cfg_attr(feature = "ts", ts(type = "string"))]
30655 pub serial_number: CharArray<16>,
30656 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
30657 #[cfg_attr(feature = "ts", ts(type = "string"))]
30658 pub device_name: CharArray<50>,
30659 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
30660 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30661 pub charging_maximum_voltage: u16,
30662 #[doc = "Number of battery cells in series. 0: field not provided."]
30663 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30664 pub cells_in_series: u8,
30665 #[doc = "Maximum pack discharge current. 0: field not provided."]
30666 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30667 pub discharge_maximum_current: u32,
30668 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
30669 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30670 pub discharge_maximum_burst_current: u32,
30671 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
30672 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30673 #[cfg_attr(feature = "ts", ts(type = "string"))]
30674 pub manufacture_date: CharArray<11>,
30675}
30676impl SMART_BATTERY_INFO_DATA {
30677 pub const ENCODED_LEN: usize = 109usize;
30678 pub const DEFAULT: Self = Self {
30679 capacity_full_specification: 0_i32,
30680 capacity_full: 0_i32,
30681 cycle_count: 0_u16,
30682 weight: 0_u16,
30683 discharge_minimum_voltage: 0_u16,
30684 charging_minimum_voltage: 0_u16,
30685 resting_minimum_voltage: 0_u16,
30686 id: 0_u8,
30687 battery_function: MavBatteryFunction::DEFAULT,
30688 mavtype: MavBatteryType::DEFAULT,
30689 serial_number: CharArray::new([0_u8; 16usize]),
30690 device_name: CharArray::new([0_u8; 50usize]),
30691 charging_maximum_voltage: 0_u16,
30692 cells_in_series: 0_u8,
30693 discharge_maximum_current: 0_u32,
30694 discharge_maximum_burst_current: 0_u32,
30695 manufacture_date: CharArray::new([0_u8; 11usize]),
30696 };
30697 #[cfg(feature = "arbitrary")]
30698 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30699 use arbitrary::{Arbitrary, Unstructured};
30700 let mut buf = [0u8; 1024];
30701 rng.fill_bytes(&mut buf);
30702 let mut unstructured = Unstructured::new(&buf);
30703 Self::arbitrary(&mut unstructured).unwrap_or_default()
30704 }
30705}
30706impl Default for SMART_BATTERY_INFO_DATA {
30707 fn default() -> Self {
30708 Self::DEFAULT.clone()
30709 }
30710}
30711impl MessageData for SMART_BATTERY_INFO_DATA {
30712 type Message = MavMessage;
30713 const ID: u32 = 370u32;
30714 const NAME: &'static str = "SMART_BATTERY_INFO";
30715 const EXTRA_CRC: u8 = 75u8;
30716 const ENCODED_LEN: usize = 109usize;
30717 fn deser(
30718 _version: MavlinkVersion,
30719 __input: &[u8],
30720 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30721 let avail_len = __input.len();
30722 let mut payload_buf = [0; Self::ENCODED_LEN];
30723 let mut buf = if avail_len < Self::ENCODED_LEN {
30724 payload_buf[0..avail_len].copy_from_slice(__input);
30725 Bytes::new(&payload_buf)
30726 } else {
30727 Bytes::new(__input)
30728 };
30729 let mut __struct = Self::default();
30730 __struct.capacity_full_specification = buf.get_i32_le();
30731 __struct.capacity_full = buf.get_i32_le();
30732 __struct.cycle_count = buf.get_u16_le();
30733 __struct.weight = buf.get_u16_le();
30734 __struct.discharge_minimum_voltage = buf.get_u16_le();
30735 __struct.charging_minimum_voltage = buf.get_u16_le();
30736 __struct.resting_minimum_voltage = buf.get_u16_le();
30737 __struct.id = buf.get_u8();
30738 let tmp = buf.get_u8();
30739 __struct.battery_function =
30740 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30741 enum_type: "MavBatteryFunction",
30742 value: tmp as u32,
30743 })?;
30744 let tmp = buf.get_u8();
30745 __struct.mavtype =
30746 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30747 enum_type: "MavBatteryType",
30748 value: tmp as u32,
30749 })?;
30750 let mut tmp = [0_u8; 16usize];
30751 for v in &mut tmp {
30752 *v = buf.get_u8();
30753 }
30754 __struct.serial_number = CharArray::new(tmp);
30755 let mut tmp = [0_u8; 50usize];
30756 for v in &mut tmp {
30757 *v = buf.get_u8();
30758 }
30759 __struct.device_name = CharArray::new(tmp);
30760 __struct.charging_maximum_voltage = buf.get_u16_le();
30761 __struct.cells_in_series = buf.get_u8();
30762 __struct.discharge_maximum_current = buf.get_u32_le();
30763 __struct.discharge_maximum_burst_current = buf.get_u32_le();
30764 let mut tmp = [0_u8; 11usize];
30765 for v in &mut tmp {
30766 *v = buf.get_u8();
30767 }
30768 __struct.manufacture_date = CharArray::new(tmp);
30769 Ok(__struct)
30770 }
30771 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30772 let mut __tmp = BytesMut::new(bytes);
30773 #[allow(clippy::absurd_extreme_comparisons)]
30774 #[allow(unused_comparisons)]
30775 if __tmp.remaining() < Self::ENCODED_LEN {
30776 panic!(
30777 "buffer is too small (need {} bytes, but got {})",
30778 Self::ENCODED_LEN,
30779 __tmp.remaining(),
30780 )
30781 }
30782 __tmp.put_i32_le(self.capacity_full_specification);
30783 __tmp.put_i32_le(self.capacity_full);
30784 __tmp.put_u16_le(self.cycle_count);
30785 __tmp.put_u16_le(self.weight);
30786 __tmp.put_u16_le(self.discharge_minimum_voltage);
30787 __tmp.put_u16_le(self.charging_minimum_voltage);
30788 __tmp.put_u16_le(self.resting_minimum_voltage);
30789 __tmp.put_u8(self.id);
30790 __tmp.put_u8(self.battery_function as u8);
30791 __tmp.put_u8(self.mavtype as u8);
30792 for val in &self.serial_number {
30793 __tmp.put_u8(*val);
30794 }
30795 for val in &self.device_name {
30796 __tmp.put_u8(*val);
30797 }
30798 if matches!(version, MavlinkVersion::V2) {
30799 __tmp.put_u16_le(self.charging_maximum_voltage);
30800 __tmp.put_u8(self.cells_in_series);
30801 __tmp.put_u32_le(self.discharge_maximum_current);
30802 __tmp.put_u32_le(self.discharge_maximum_burst_current);
30803 for val in &self.manufacture_date {
30804 __tmp.put_u8(*val);
30805 }
30806 let len = __tmp.len();
30807 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30808 } else {
30809 __tmp.len()
30810 }
30811 }
30812}
30813#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
30814#[doc = ""]
30815#[doc = "ID: 253"]
30816#[derive(Debug, Clone, PartialEq)]
30817#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30818#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30819#[cfg_attr(feature = "ts", derive(TS))]
30820#[cfg_attr(feature = "ts", ts(export))]
30821pub struct STATUSTEXT_DATA {
30822 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
30823 pub severity: MavSeverity,
30824 #[doc = "Status text message, without null termination character"]
30825 #[cfg_attr(feature = "ts", ts(type = "string"))]
30826 pub text: CharArray<50>,
30827 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
30828 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30829 pub id: u16,
30830 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
30831 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30832 pub chunk_seq: u8,
30833}
30834impl STATUSTEXT_DATA {
30835 pub const ENCODED_LEN: usize = 54usize;
30836 pub const DEFAULT: Self = Self {
30837 severity: MavSeverity::DEFAULT,
30838 text: CharArray::new([0_u8; 50usize]),
30839 id: 0_u16,
30840 chunk_seq: 0_u8,
30841 };
30842 #[cfg(feature = "arbitrary")]
30843 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30844 use arbitrary::{Arbitrary, Unstructured};
30845 let mut buf = [0u8; 1024];
30846 rng.fill_bytes(&mut buf);
30847 let mut unstructured = Unstructured::new(&buf);
30848 Self::arbitrary(&mut unstructured).unwrap_or_default()
30849 }
30850}
30851impl Default for STATUSTEXT_DATA {
30852 fn default() -> Self {
30853 Self::DEFAULT.clone()
30854 }
30855}
30856impl MessageData for STATUSTEXT_DATA {
30857 type Message = MavMessage;
30858 const ID: u32 = 253u32;
30859 const NAME: &'static str = "STATUSTEXT";
30860 const EXTRA_CRC: u8 = 83u8;
30861 const ENCODED_LEN: usize = 54usize;
30862 fn deser(
30863 _version: MavlinkVersion,
30864 __input: &[u8],
30865 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30866 let avail_len = __input.len();
30867 let mut payload_buf = [0; Self::ENCODED_LEN];
30868 let mut buf = if avail_len < Self::ENCODED_LEN {
30869 payload_buf[0..avail_len].copy_from_slice(__input);
30870 Bytes::new(&payload_buf)
30871 } else {
30872 Bytes::new(__input)
30873 };
30874 let mut __struct = Self::default();
30875 let tmp = buf.get_u8();
30876 __struct.severity =
30877 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30878 enum_type: "MavSeverity",
30879 value: tmp as u32,
30880 })?;
30881 let mut tmp = [0_u8; 50usize];
30882 for v in &mut tmp {
30883 *v = buf.get_u8();
30884 }
30885 __struct.text = CharArray::new(tmp);
30886 __struct.id = buf.get_u16_le();
30887 __struct.chunk_seq = buf.get_u8();
30888 Ok(__struct)
30889 }
30890 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30891 let mut __tmp = BytesMut::new(bytes);
30892 #[allow(clippy::absurd_extreme_comparisons)]
30893 #[allow(unused_comparisons)]
30894 if __tmp.remaining() < Self::ENCODED_LEN {
30895 panic!(
30896 "buffer is too small (need {} bytes, but got {})",
30897 Self::ENCODED_LEN,
30898 __tmp.remaining(),
30899 )
30900 }
30901 __tmp.put_u8(self.severity as u8);
30902 for val in &self.text {
30903 __tmp.put_u8(*val);
30904 }
30905 if matches!(version, MavlinkVersion::V2) {
30906 __tmp.put_u16_le(self.id);
30907 __tmp.put_u8(self.chunk_seq);
30908 let len = __tmp.len();
30909 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30910 } else {
30911 __tmp.len()
30912 }
30913 }
30914}
30915#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
30916#[doc = ""]
30917#[doc = "ID: 261"]
30918#[derive(Debug, Clone, PartialEq)]
30919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30921#[cfg_attr(feature = "ts", derive(TS))]
30922#[cfg_attr(feature = "ts", ts(export))]
30923pub struct STORAGE_INFORMATION_DATA {
30924 #[doc = "Timestamp (time since system boot)."]
30925 pub time_boot_ms: u32,
30926 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
30927 pub total_capacity: f32,
30928 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
30929 pub used_capacity: f32,
30930 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
30931 pub available_capacity: f32,
30932 #[doc = "Read speed."]
30933 pub read_speed: f32,
30934 #[doc = "Write speed."]
30935 pub write_speed: f32,
30936 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
30937 pub storage_id: u8,
30938 #[doc = "Number of storage devices"]
30939 pub storage_count: u8,
30940 #[doc = "Status of storage"]
30941 pub status: StorageStatus,
30942 #[doc = "Type of storage"]
30943 #[cfg_attr(feature = "serde", serde(default))]
30944 pub mavtype: StorageType,
30945 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
30946 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30947 #[cfg_attr(feature = "ts", ts(type = "string"))]
30948 pub name: CharArray<32>,
30949 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
30950 #[cfg_attr(feature = "serde", serde(default))]
30951 pub storage_usage: StorageUsageFlag,
30952}
30953impl STORAGE_INFORMATION_DATA {
30954 pub const ENCODED_LEN: usize = 61usize;
30955 pub const DEFAULT: Self = Self {
30956 time_boot_ms: 0_u32,
30957 total_capacity: 0.0_f32,
30958 used_capacity: 0.0_f32,
30959 available_capacity: 0.0_f32,
30960 read_speed: 0.0_f32,
30961 write_speed: 0.0_f32,
30962 storage_id: 0_u8,
30963 storage_count: 0_u8,
30964 status: StorageStatus::DEFAULT,
30965 mavtype: StorageType::DEFAULT,
30966 name: CharArray::new([0_u8; 32usize]),
30967 storage_usage: StorageUsageFlag::DEFAULT,
30968 };
30969 #[cfg(feature = "arbitrary")]
30970 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30971 use arbitrary::{Arbitrary, Unstructured};
30972 let mut buf = [0u8; 1024];
30973 rng.fill_bytes(&mut buf);
30974 let mut unstructured = Unstructured::new(&buf);
30975 Self::arbitrary(&mut unstructured).unwrap_or_default()
30976 }
30977}
30978impl Default for STORAGE_INFORMATION_DATA {
30979 fn default() -> Self {
30980 Self::DEFAULT.clone()
30981 }
30982}
30983impl MessageData for STORAGE_INFORMATION_DATA {
30984 type Message = MavMessage;
30985 const ID: u32 = 261u32;
30986 const NAME: &'static str = "STORAGE_INFORMATION";
30987 const EXTRA_CRC: u8 = 179u8;
30988 const ENCODED_LEN: usize = 61usize;
30989 fn deser(
30990 _version: MavlinkVersion,
30991 __input: &[u8],
30992 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30993 let avail_len = __input.len();
30994 let mut payload_buf = [0; Self::ENCODED_LEN];
30995 let mut buf = if avail_len < Self::ENCODED_LEN {
30996 payload_buf[0..avail_len].copy_from_slice(__input);
30997 Bytes::new(&payload_buf)
30998 } else {
30999 Bytes::new(__input)
31000 };
31001 let mut __struct = Self::default();
31002 __struct.time_boot_ms = buf.get_u32_le();
31003 __struct.total_capacity = buf.get_f32_le();
31004 __struct.used_capacity = buf.get_f32_le();
31005 __struct.available_capacity = buf.get_f32_le();
31006 __struct.read_speed = buf.get_f32_le();
31007 __struct.write_speed = buf.get_f32_le();
31008 __struct.storage_id = buf.get_u8();
31009 __struct.storage_count = buf.get_u8();
31010 let tmp = buf.get_u8();
31011 __struct.status =
31012 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31013 enum_type: "StorageStatus",
31014 value: tmp as u32,
31015 })?;
31016 let tmp = buf.get_u8();
31017 __struct.mavtype =
31018 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31019 enum_type: "StorageType",
31020 value: tmp as u32,
31021 })?;
31022 let mut tmp = [0_u8; 32usize];
31023 for v in &mut tmp {
31024 *v = buf.get_u8();
31025 }
31026 __struct.name = CharArray::new(tmp);
31027 let tmp = buf.get_u8();
31028 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
31029 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31030 flag_type: "StorageUsageFlag",
31031 value: tmp as u32,
31032 })?;
31033 Ok(__struct)
31034 }
31035 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31036 let mut __tmp = BytesMut::new(bytes);
31037 #[allow(clippy::absurd_extreme_comparisons)]
31038 #[allow(unused_comparisons)]
31039 if __tmp.remaining() < Self::ENCODED_LEN {
31040 panic!(
31041 "buffer is too small (need {} bytes, but got {})",
31042 Self::ENCODED_LEN,
31043 __tmp.remaining(),
31044 )
31045 }
31046 __tmp.put_u32_le(self.time_boot_ms);
31047 __tmp.put_f32_le(self.total_capacity);
31048 __tmp.put_f32_le(self.used_capacity);
31049 __tmp.put_f32_le(self.available_capacity);
31050 __tmp.put_f32_le(self.read_speed);
31051 __tmp.put_f32_le(self.write_speed);
31052 __tmp.put_u8(self.storage_id);
31053 __tmp.put_u8(self.storage_count);
31054 __tmp.put_u8(self.status as u8);
31055 if matches!(version, MavlinkVersion::V2) {
31056 __tmp.put_u8(self.mavtype as u8);
31057 for val in &self.name {
31058 __tmp.put_u8(*val);
31059 }
31060 __tmp.put_u8(self.storage_usage.bits());
31061 let len = __tmp.len();
31062 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31063 } else {
31064 __tmp.len()
31065 }
31066 }
31067}
31068#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
31069#[doc = ""]
31070#[doc = "ID: 401"]
31071#[derive(Debug, Clone, PartialEq)]
31072#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31073#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31074#[cfg_attr(feature = "ts", derive(TS))]
31075#[cfg_attr(feature = "ts", ts(export))]
31076pub struct SUPPORTED_TUNES_DATA {
31077 #[doc = "Bitfield of supported tune formats."]
31078 pub format: TuneFormat,
31079 #[doc = "System ID"]
31080 pub target_system: u8,
31081 #[doc = "Component ID"]
31082 pub target_component: u8,
31083}
31084impl SUPPORTED_TUNES_DATA {
31085 pub const ENCODED_LEN: usize = 6usize;
31086 pub const DEFAULT: Self = Self {
31087 format: TuneFormat::DEFAULT,
31088 target_system: 0_u8,
31089 target_component: 0_u8,
31090 };
31091 #[cfg(feature = "arbitrary")]
31092 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31093 use arbitrary::{Arbitrary, Unstructured};
31094 let mut buf = [0u8; 1024];
31095 rng.fill_bytes(&mut buf);
31096 let mut unstructured = Unstructured::new(&buf);
31097 Self::arbitrary(&mut unstructured).unwrap_or_default()
31098 }
31099}
31100impl Default for SUPPORTED_TUNES_DATA {
31101 fn default() -> Self {
31102 Self::DEFAULT.clone()
31103 }
31104}
31105impl MessageData for SUPPORTED_TUNES_DATA {
31106 type Message = MavMessage;
31107 const ID: u32 = 401u32;
31108 const NAME: &'static str = "SUPPORTED_TUNES";
31109 const EXTRA_CRC: u8 = 183u8;
31110 const ENCODED_LEN: usize = 6usize;
31111 fn deser(
31112 _version: MavlinkVersion,
31113 __input: &[u8],
31114 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31115 let avail_len = __input.len();
31116 let mut payload_buf = [0; Self::ENCODED_LEN];
31117 let mut buf = if avail_len < Self::ENCODED_LEN {
31118 payload_buf[0..avail_len].copy_from_slice(__input);
31119 Bytes::new(&payload_buf)
31120 } else {
31121 Bytes::new(__input)
31122 };
31123 let mut __struct = Self::default();
31124 let tmp = buf.get_u32_le();
31125 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
31126 ::mavlink_core::error::ParserError::InvalidEnum {
31127 enum_type: "TuneFormat",
31128 value: tmp as u32,
31129 },
31130 )?;
31131 __struct.target_system = buf.get_u8();
31132 __struct.target_component = buf.get_u8();
31133 Ok(__struct)
31134 }
31135 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31136 let mut __tmp = BytesMut::new(bytes);
31137 #[allow(clippy::absurd_extreme_comparisons)]
31138 #[allow(unused_comparisons)]
31139 if __tmp.remaining() < Self::ENCODED_LEN {
31140 panic!(
31141 "buffer is too small (need {} bytes, but got {})",
31142 Self::ENCODED_LEN,
31143 __tmp.remaining(),
31144 )
31145 }
31146 __tmp.put_u32_le(self.format as u32);
31147 __tmp.put_u8(self.target_system);
31148 __tmp.put_u8(self.target_component);
31149 if matches!(version, MavlinkVersion::V2) {
31150 let len = __tmp.len();
31151 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31152 } else {
31153 __tmp.len()
31154 }
31155 }
31156}
31157#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
31158#[doc = ""]
31159#[doc = "ID: 2"]
31160#[derive(Debug, Clone, PartialEq)]
31161#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31162#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31163#[cfg_attr(feature = "ts", derive(TS))]
31164#[cfg_attr(feature = "ts", ts(export))]
31165pub struct SYSTEM_TIME_DATA {
31166 #[doc = "Timestamp (UNIX epoch time)."]
31167 pub time_unix_usec: u64,
31168 #[doc = "Timestamp (time since system boot)."]
31169 pub time_boot_ms: u32,
31170}
31171impl SYSTEM_TIME_DATA {
31172 pub const ENCODED_LEN: usize = 12usize;
31173 pub const DEFAULT: Self = Self {
31174 time_unix_usec: 0_u64,
31175 time_boot_ms: 0_u32,
31176 };
31177 #[cfg(feature = "arbitrary")]
31178 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31179 use arbitrary::{Arbitrary, Unstructured};
31180 let mut buf = [0u8; 1024];
31181 rng.fill_bytes(&mut buf);
31182 let mut unstructured = Unstructured::new(&buf);
31183 Self::arbitrary(&mut unstructured).unwrap_or_default()
31184 }
31185}
31186impl Default for SYSTEM_TIME_DATA {
31187 fn default() -> Self {
31188 Self::DEFAULT.clone()
31189 }
31190}
31191impl MessageData for SYSTEM_TIME_DATA {
31192 type Message = MavMessage;
31193 const ID: u32 = 2u32;
31194 const NAME: &'static str = "SYSTEM_TIME";
31195 const EXTRA_CRC: u8 = 137u8;
31196 const ENCODED_LEN: usize = 12usize;
31197 fn deser(
31198 _version: MavlinkVersion,
31199 __input: &[u8],
31200 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31201 let avail_len = __input.len();
31202 let mut payload_buf = [0; Self::ENCODED_LEN];
31203 let mut buf = if avail_len < Self::ENCODED_LEN {
31204 payload_buf[0..avail_len].copy_from_slice(__input);
31205 Bytes::new(&payload_buf)
31206 } else {
31207 Bytes::new(__input)
31208 };
31209 let mut __struct = Self::default();
31210 __struct.time_unix_usec = buf.get_u64_le();
31211 __struct.time_boot_ms = buf.get_u32_le();
31212 Ok(__struct)
31213 }
31214 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31215 let mut __tmp = BytesMut::new(bytes);
31216 #[allow(clippy::absurd_extreme_comparisons)]
31217 #[allow(unused_comparisons)]
31218 if __tmp.remaining() < Self::ENCODED_LEN {
31219 panic!(
31220 "buffer is too small (need {} bytes, but got {})",
31221 Self::ENCODED_LEN,
31222 __tmp.remaining(),
31223 )
31224 }
31225 __tmp.put_u64_le(self.time_unix_usec);
31226 __tmp.put_u32_le(self.time_boot_ms);
31227 if matches!(version, MavlinkVersion::V2) {
31228 let len = __tmp.len();
31229 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31230 } else {
31231 __tmp.len()
31232 }
31233 }
31234}
31235#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
31236#[doc = ""]
31237#[doc = "ID: 1"]
31238#[derive(Debug, Clone, PartialEq)]
31239#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31240#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31241#[cfg_attr(feature = "ts", derive(TS))]
31242#[cfg_attr(feature = "ts", ts(export))]
31243pub struct SYS_STATUS_DATA {
31244 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
31245 pub onboard_control_sensors_present: MavSysStatusSensor,
31246 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
31247 pub onboard_control_sensors_enabled: MavSysStatusSensor,
31248 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
31249 pub onboard_control_sensors_health: MavSysStatusSensor,
31250 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
31251 pub load: u16,
31252 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
31253 pub voltage_battery: u16,
31254 #[doc = "Battery current, -1: Current not sent by autopilot"]
31255 pub current_battery: i16,
31256 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
31257 pub drop_rate_comm: u16,
31258 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
31259 pub errors_comm: u16,
31260 #[doc = "Autopilot-specific errors"]
31261 pub errors_count1: u16,
31262 #[doc = "Autopilot-specific errors"]
31263 pub errors_count2: u16,
31264 #[doc = "Autopilot-specific errors"]
31265 pub errors_count3: u16,
31266 #[doc = "Autopilot-specific errors"]
31267 pub errors_count4: u16,
31268 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
31269 pub battery_remaining: i8,
31270 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
31271 #[cfg_attr(feature = "serde", serde(default))]
31272 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
31273 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
31274 #[cfg_attr(feature = "serde", serde(default))]
31275 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
31276 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
31277 #[cfg_attr(feature = "serde", serde(default))]
31278 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
31279}
31280impl SYS_STATUS_DATA {
31281 pub const ENCODED_LEN: usize = 43usize;
31282 pub const DEFAULT: Self = Self {
31283 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
31284 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
31285 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
31286 load: 0_u16,
31287 voltage_battery: 0_u16,
31288 current_battery: 0_i16,
31289 drop_rate_comm: 0_u16,
31290 errors_comm: 0_u16,
31291 errors_count1: 0_u16,
31292 errors_count2: 0_u16,
31293 errors_count3: 0_u16,
31294 errors_count4: 0_u16,
31295 battery_remaining: 0_i8,
31296 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
31297 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
31298 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
31299 };
31300 #[cfg(feature = "arbitrary")]
31301 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31302 use arbitrary::{Arbitrary, Unstructured};
31303 let mut buf = [0u8; 1024];
31304 rng.fill_bytes(&mut buf);
31305 let mut unstructured = Unstructured::new(&buf);
31306 Self::arbitrary(&mut unstructured).unwrap_or_default()
31307 }
31308}
31309impl Default for SYS_STATUS_DATA {
31310 fn default() -> Self {
31311 Self::DEFAULT.clone()
31312 }
31313}
31314impl MessageData for SYS_STATUS_DATA {
31315 type Message = MavMessage;
31316 const ID: u32 = 1u32;
31317 const NAME: &'static str = "SYS_STATUS";
31318 const EXTRA_CRC: u8 = 124u8;
31319 const ENCODED_LEN: usize = 43usize;
31320 fn deser(
31321 _version: MavlinkVersion,
31322 __input: &[u8],
31323 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31324 let avail_len = __input.len();
31325 let mut payload_buf = [0; Self::ENCODED_LEN];
31326 let mut buf = if avail_len < Self::ENCODED_LEN {
31327 payload_buf[0..avail_len].copy_from_slice(__input);
31328 Bytes::new(&payload_buf)
31329 } else {
31330 Bytes::new(__input)
31331 };
31332 let mut __struct = Self::default();
31333 let tmp = buf.get_u32_le();
31334 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
31335 tmp & MavSysStatusSensor::all().bits(),
31336 )
31337 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31338 flag_type: "MavSysStatusSensor",
31339 value: tmp as u32,
31340 })?;
31341 let tmp = buf.get_u32_le();
31342 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
31343 tmp & MavSysStatusSensor::all().bits(),
31344 )
31345 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31346 flag_type: "MavSysStatusSensor",
31347 value: tmp as u32,
31348 })?;
31349 let tmp = buf.get_u32_le();
31350 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
31351 tmp & MavSysStatusSensor::all().bits(),
31352 )
31353 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31354 flag_type: "MavSysStatusSensor",
31355 value: tmp as u32,
31356 })?;
31357 __struct.load = buf.get_u16_le();
31358 __struct.voltage_battery = buf.get_u16_le();
31359 __struct.current_battery = buf.get_i16_le();
31360 __struct.drop_rate_comm = buf.get_u16_le();
31361 __struct.errors_comm = buf.get_u16_le();
31362 __struct.errors_count1 = buf.get_u16_le();
31363 __struct.errors_count2 = buf.get_u16_le();
31364 __struct.errors_count3 = buf.get_u16_le();
31365 __struct.errors_count4 = buf.get_u16_le();
31366 __struct.battery_remaining = buf.get_i8();
31367 let tmp = buf.get_u32_le();
31368 __struct.onboard_control_sensors_present_extended =
31369 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
31370 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31371 flag_type: "MavSysStatusSensorExtended",
31372 value: tmp as u32,
31373 })?;
31374 let tmp = buf.get_u32_le();
31375 __struct.onboard_control_sensors_enabled_extended =
31376 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
31377 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31378 flag_type: "MavSysStatusSensorExtended",
31379 value: tmp as u32,
31380 })?;
31381 let tmp = buf.get_u32_le();
31382 __struct.onboard_control_sensors_health_extended =
31383 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
31384 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31385 flag_type: "MavSysStatusSensorExtended",
31386 value: tmp as u32,
31387 })?;
31388 Ok(__struct)
31389 }
31390 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31391 let mut __tmp = BytesMut::new(bytes);
31392 #[allow(clippy::absurd_extreme_comparisons)]
31393 #[allow(unused_comparisons)]
31394 if __tmp.remaining() < Self::ENCODED_LEN {
31395 panic!(
31396 "buffer is too small (need {} bytes, but got {})",
31397 Self::ENCODED_LEN,
31398 __tmp.remaining(),
31399 )
31400 }
31401 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
31402 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
31403 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
31404 __tmp.put_u16_le(self.load);
31405 __tmp.put_u16_le(self.voltage_battery);
31406 __tmp.put_i16_le(self.current_battery);
31407 __tmp.put_u16_le(self.drop_rate_comm);
31408 __tmp.put_u16_le(self.errors_comm);
31409 __tmp.put_u16_le(self.errors_count1);
31410 __tmp.put_u16_le(self.errors_count2);
31411 __tmp.put_u16_le(self.errors_count3);
31412 __tmp.put_u16_le(self.errors_count4);
31413 __tmp.put_i8(self.battery_remaining);
31414 if matches!(version, MavlinkVersion::V2) {
31415 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
31416 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
31417 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
31418 let len = __tmp.len();
31419 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31420 } else {
31421 __tmp.len()
31422 }
31423 }
31424}
31425#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
31426#[doc = ""]
31427#[doc = "ID: 135"]
31428#[derive(Debug, Clone, PartialEq)]
31429#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31430#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31431#[cfg_attr(feature = "ts", derive(TS))]
31432#[cfg_attr(feature = "ts", ts(export))]
31433pub struct TERRAIN_CHECK_DATA {
31434 #[doc = "Latitude"]
31435 pub lat: i32,
31436 #[doc = "Longitude"]
31437 pub lon: i32,
31438}
31439impl TERRAIN_CHECK_DATA {
31440 pub const ENCODED_LEN: usize = 8usize;
31441 pub const DEFAULT: Self = Self {
31442 lat: 0_i32,
31443 lon: 0_i32,
31444 };
31445 #[cfg(feature = "arbitrary")]
31446 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31447 use arbitrary::{Arbitrary, Unstructured};
31448 let mut buf = [0u8; 1024];
31449 rng.fill_bytes(&mut buf);
31450 let mut unstructured = Unstructured::new(&buf);
31451 Self::arbitrary(&mut unstructured).unwrap_or_default()
31452 }
31453}
31454impl Default for TERRAIN_CHECK_DATA {
31455 fn default() -> Self {
31456 Self::DEFAULT.clone()
31457 }
31458}
31459impl MessageData for TERRAIN_CHECK_DATA {
31460 type Message = MavMessage;
31461 const ID: u32 = 135u32;
31462 const NAME: &'static str = "TERRAIN_CHECK";
31463 const EXTRA_CRC: u8 = 203u8;
31464 const ENCODED_LEN: usize = 8usize;
31465 fn deser(
31466 _version: MavlinkVersion,
31467 __input: &[u8],
31468 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31469 let avail_len = __input.len();
31470 let mut payload_buf = [0; Self::ENCODED_LEN];
31471 let mut buf = if avail_len < Self::ENCODED_LEN {
31472 payload_buf[0..avail_len].copy_from_slice(__input);
31473 Bytes::new(&payload_buf)
31474 } else {
31475 Bytes::new(__input)
31476 };
31477 let mut __struct = Self::default();
31478 __struct.lat = buf.get_i32_le();
31479 __struct.lon = buf.get_i32_le();
31480 Ok(__struct)
31481 }
31482 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31483 let mut __tmp = BytesMut::new(bytes);
31484 #[allow(clippy::absurd_extreme_comparisons)]
31485 #[allow(unused_comparisons)]
31486 if __tmp.remaining() < Self::ENCODED_LEN {
31487 panic!(
31488 "buffer is too small (need {} bytes, but got {})",
31489 Self::ENCODED_LEN,
31490 __tmp.remaining(),
31491 )
31492 }
31493 __tmp.put_i32_le(self.lat);
31494 __tmp.put_i32_le(self.lon);
31495 if matches!(version, MavlinkVersion::V2) {
31496 let len = __tmp.len();
31497 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31498 } else {
31499 __tmp.len()
31500 }
31501 }
31502}
31503#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
31504#[doc = ""]
31505#[doc = "ID: 134"]
31506#[derive(Debug, Clone, PartialEq)]
31507#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31509#[cfg_attr(feature = "ts", derive(TS))]
31510#[cfg_attr(feature = "ts", ts(export))]
31511pub struct TERRAIN_DATA_DATA {
31512 #[doc = "Latitude of SW corner of first grid"]
31513 pub lat: i32,
31514 #[doc = "Longitude of SW corner of first grid"]
31515 pub lon: i32,
31516 #[doc = "Grid spacing"]
31517 pub grid_spacing: u16,
31518 #[doc = "Terrain data MSL"]
31519 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31520 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31521 pub data: [i16; 16],
31522 #[doc = "bit within the terrain request mask"]
31523 pub gridbit: u8,
31524}
31525impl TERRAIN_DATA_DATA {
31526 pub const ENCODED_LEN: usize = 43usize;
31527 pub const DEFAULT: Self = Self {
31528 lat: 0_i32,
31529 lon: 0_i32,
31530 grid_spacing: 0_u16,
31531 data: [0_i16; 16usize],
31532 gridbit: 0_u8,
31533 };
31534 #[cfg(feature = "arbitrary")]
31535 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31536 use arbitrary::{Arbitrary, Unstructured};
31537 let mut buf = [0u8; 1024];
31538 rng.fill_bytes(&mut buf);
31539 let mut unstructured = Unstructured::new(&buf);
31540 Self::arbitrary(&mut unstructured).unwrap_or_default()
31541 }
31542}
31543impl Default for TERRAIN_DATA_DATA {
31544 fn default() -> Self {
31545 Self::DEFAULT.clone()
31546 }
31547}
31548impl MessageData for TERRAIN_DATA_DATA {
31549 type Message = MavMessage;
31550 const ID: u32 = 134u32;
31551 const NAME: &'static str = "TERRAIN_DATA";
31552 const EXTRA_CRC: u8 = 229u8;
31553 const ENCODED_LEN: usize = 43usize;
31554 fn deser(
31555 _version: MavlinkVersion,
31556 __input: &[u8],
31557 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31558 let avail_len = __input.len();
31559 let mut payload_buf = [0; Self::ENCODED_LEN];
31560 let mut buf = if avail_len < Self::ENCODED_LEN {
31561 payload_buf[0..avail_len].copy_from_slice(__input);
31562 Bytes::new(&payload_buf)
31563 } else {
31564 Bytes::new(__input)
31565 };
31566 let mut __struct = Self::default();
31567 __struct.lat = buf.get_i32_le();
31568 __struct.lon = buf.get_i32_le();
31569 __struct.grid_spacing = buf.get_u16_le();
31570 for v in &mut __struct.data {
31571 let val = buf.get_i16_le();
31572 *v = val;
31573 }
31574 __struct.gridbit = buf.get_u8();
31575 Ok(__struct)
31576 }
31577 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31578 let mut __tmp = BytesMut::new(bytes);
31579 #[allow(clippy::absurd_extreme_comparisons)]
31580 #[allow(unused_comparisons)]
31581 if __tmp.remaining() < Self::ENCODED_LEN {
31582 panic!(
31583 "buffer is too small (need {} bytes, but got {})",
31584 Self::ENCODED_LEN,
31585 __tmp.remaining(),
31586 )
31587 }
31588 __tmp.put_i32_le(self.lat);
31589 __tmp.put_i32_le(self.lon);
31590 __tmp.put_u16_le(self.grid_spacing);
31591 for val in &self.data {
31592 __tmp.put_i16_le(*val);
31593 }
31594 __tmp.put_u8(self.gridbit);
31595 if matches!(version, MavlinkVersion::V2) {
31596 let len = __tmp.len();
31597 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31598 } else {
31599 __tmp.len()
31600 }
31601 }
31602}
31603#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
31604#[doc = ""]
31605#[doc = "ID: 136"]
31606#[derive(Debug, Clone, PartialEq)]
31607#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31609#[cfg_attr(feature = "ts", derive(TS))]
31610#[cfg_attr(feature = "ts", ts(export))]
31611pub struct TERRAIN_REPORT_DATA {
31612 #[doc = "Latitude"]
31613 pub lat: i32,
31614 #[doc = "Longitude"]
31615 pub lon: i32,
31616 #[doc = "Terrain height MSL"]
31617 pub terrain_height: f32,
31618 #[doc = "Current vehicle height above lat/lon terrain height"]
31619 pub current_height: f32,
31620 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
31621 pub spacing: u16,
31622 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
31623 pub pending: u16,
31624 #[doc = "Number of 4x4 terrain blocks in memory"]
31625 pub loaded: u16,
31626}
31627impl TERRAIN_REPORT_DATA {
31628 pub const ENCODED_LEN: usize = 22usize;
31629 pub const DEFAULT: Self = Self {
31630 lat: 0_i32,
31631 lon: 0_i32,
31632 terrain_height: 0.0_f32,
31633 current_height: 0.0_f32,
31634 spacing: 0_u16,
31635 pending: 0_u16,
31636 loaded: 0_u16,
31637 };
31638 #[cfg(feature = "arbitrary")]
31639 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31640 use arbitrary::{Arbitrary, Unstructured};
31641 let mut buf = [0u8; 1024];
31642 rng.fill_bytes(&mut buf);
31643 let mut unstructured = Unstructured::new(&buf);
31644 Self::arbitrary(&mut unstructured).unwrap_or_default()
31645 }
31646}
31647impl Default for TERRAIN_REPORT_DATA {
31648 fn default() -> Self {
31649 Self::DEFAULT.clone()
31650 }
31651}
31652impl MessageData for TERRAIN_REPORT_DATA {
31653 type Message = MavMessage;
31654 const ID: u32 = 136u32;
31655 const NAME: &'static str = "TERRAIN_REPORT";
31656 const EXTRA_CRC: u8 = 1u8;
31657 const ENCODED_LEN: usize = 22usize;
31658 fn deser(
31659 _version: MavlinkVersion,
31660 __input: &[u8],
31661 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31662 let avail_len = __input.len();
31663 let mut payload_buf = [0; Self::ENCODED_LEN];
31664 let mut buf = if avail_len < Self::ENCODED_LEN {
31665 payload_buf[0..avail_len].copy_from_slice(__input);
31666 Bytes::new(&payload_buf)
31667 } else {
31668 Bytes::new(__input)
31669 };
31670 let mut __struct = Self::default();
31671 __struct.lat = buf.get_i32_le();
31672 __struct.lon = buf.get_i32_le();
31673 __struct.terrain_height = buf.get_f32_le();
31674 __struct.current_height = buf.get_f32_le();
31675 __struct.spacing = buf.get_u16_le();
31676 __struct.pending = buf.get_u16_le();
31677 __struct.loaded = buf.get_u16_le();
31678 Ok(__struct)
31679 }
31680 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31681 let mut __tmp = BytesMut::new(bytes);
31682 #[allow(clippy::absurd_extreme_comparisons)]
31683 #[allow(unused_comparisons)]
31684 if __tmp.remaining() < Self::ENCODED_LEN {
31685 panic!(
31686 "buffer is too small (need {} bytes, but got {})",
31687 Self::ENCODED_LEN,
31688 __tmp.remaining(),
31689 )
31690 }
31691 __tmp.put_i32_le(self.lat);
31692 __tmp.put_i32_le(self.lon);
31693 __tmp.put_f32_le(self.terrain_height);
31694 __tmp.put_f32_le(self.current_height);
31695 __tmp.put_u16_le(self.spacing);
31696 __tmp.put_u16_le(self.pending);
31697 __tmp.put_u16_le(self.loaded);
31698 if matches!(version, MavlinkVersion::V2) {
31699 let len = __tmp.len();
31700 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31701 } else {
31702 __tmp.len()
31703 }
31704 }
31705}
31706#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
31707#[doc = ""]
31708#[doc = "ID: 133"]
31709#[derive(Debug, Clone, PartialEq)]
31710#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31711#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31712#[cfg_attr(feature = "ts", derive(TS))]
31713#[cfg_attr(feature = "ts", ts(export))]
31714pub struct TERRAIN_REQUEST_DATA {
31715 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
31716 pub mask: u64,
31717 #[doc = "Latitude of SW corner of first grid"]
31718 pub lat: i32,
31719 #[doc = "Longitude of SW corner of first grid"]
31720 pub lon: i32,
31721 #[doc = "Grid spacing"]
31722 pub grid_spacing: u16,
31723}
31724impl TERRAIN_REQUEST_DATA {
31725 pub const ENCODED_LEN: usize = 18usize;
31726 pub const DEFAULT: Self = Self {
31727 mask: 0_u64,
31728 lat: 0_i32,
31729 lon: 0_i32,
31730 grid_spacing: 0_u16,
31731 };
31732 #[cfg(feature = "arbitrary")]
31733 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31734 use arbitrary::{Arbitrary, Unstructured};
31735 let mut buf = [0u8; 1024];
31736 rng.fill_bytes(&mut buf);
31737 let mut unstructured = Unstructured::new(&buf);
31738 Self::arbitrary(&mut unstructured).unwrap_or_default()
31739 }
31740}
31741impl Default for TERRAIN_REQUEST_DATA {
31742 fn default() -> Self {
31743 Self::DEFAULT.clone()
31744 }
31745}
31746impl MessageData for TERRAIN_REQUEST_DATA {
31747 type Message = MavMessage;
31748 const ID: u32 = 133u32;
31749 const NAME: &'static str = "TERRAIN_REQUEST";
31750 const EXTRA_CRC: u8 = 6u8;
31751 const ENCODED_LEN: usize = 18usize;
31752 fn deser(
31753 _version: MavlinkVersion,
31754 __input: &[u8],
31755 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31756 let avail_len = __input.len();
31757 let mut payload_buf = [0; Self::ENCODED_LEN];
31758 let mut buf = if avail_len < Self::ENCODED_LEN {
31759 payload_buf[0..avail_len].copy_from_slice(__input);
31760 Bytes::new(&payload_buf)
31761 } else {
31762 Bytes::new(__input)
31763 };
31764 let mut __struct = Self::default();
31765 __struct.mask = buf.get_u64_le();
31766 __struct.lat = buf.get_i32_le();
31767 __struct.lon = buf.get_i32_le();
31768 __struct.grid_spacing = buf.get_u16_le();
31769 Ok(__struct)
31770 }
31771 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31772 let mut __tmp = BytesMut::new(bytes);
31773 #[allow(clippy::absurd_extreme_comparisons)]
31774 #[allow(unused_comparisons)]
31775 if __tmp.remaining() < Self::ENCODED_LEN {
31776 panic!(
31777 "buffer is too small (need {} bytes, but got {})",
31778 Self::ENCODED_LEN,
31779 __tmp.remaining(),
31780 )
31781 }
31782 __tmp.put_u64_le(self.mask);
31783 __tmp.put_i32_le(self.lat);
31784 __tmp.put_i32_le(self.lon);
31785 __tmp.put_u16_le(self.grid_spacing);
31786 if matches!(version, MavlinkVersion::V2) {
31787 let len = __tmp.len();
31788 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31789 } else {
31790 __tmp.len()
31791 }
31792 }
31793}
31794#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
31795#[doc = ""]
31796#[doc = "ID: 111"]
31797#[derive(Debug, Clone, PartialEq)]
31798#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31799#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31800#[cfg_attr(feature = "ts", derive(TS))]
31801#[cfg_attr(feature = "ts", ts(export))]
31802pub struct TIMESYNC_DATA {
31803 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
31804 pub tc1: i64,
31805 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
31806 pub ts1: i64,
31807 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
31808 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31809 pub target_system: u8,
31810 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
31811 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31812 pub target_component: u8,
31813}
31814impl TIMESYNC_DATA {
31815 pub const ENCODED_LEN: usize = 18usize;
31816 pub const DEFAULT: Self = Self {
31817 tc1: 0_i64,
31818 ts1: 0_i64,
31819 target_system: 0_u8,
31820 target_component: 0_u8,
31821 };
31822 #[cfg(feature = "arbitrary")]
31823 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31824 use arbitrary::{Arbitrary, Unstructured};
31825 let mut buf = [0u8; 1024];
31826 rng.fill_bytes(&mut buf);
31827 let mut unstructured = Unstructured::new(&buf);
31828 Self::arbitrary(&mut unstructured).unwrap_or_default()
31829 }
31830}
31831impl Default for TIMESYNC_DATA {
31832 fn default() -> Self {
31833 Self::DEFAULT.clone()
31834 }
31835}
31836impl MessageData for TIMESYNC_DATA {
31837 type Message = MavMessage;
31838 const ID: u32 = 111u32;
31839 const NAME: &'static str = "TIMESYNC";
31840 const EXTRA_CRC: u8 = 34u8;
31841 const ENCODED_LEN: usize = 18usize;
31842 fn deser(
31843 _version: MavlinkVersion,
31844 __input: &[u8],
31845 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31846 let avail_len = __input.len();
31847 let mut payload_buf = [0; Self::ENCODED_LEN];
31848 let mut buf = if avail_len < Self::ENCODED_LEN {
31849 payload_buf[0..avail_len].copy_from_slice(__input);
31850 Bytes::new(&payload_buf)
31851 } else {
31852 Bytes::new(__input)
31853 };
31854 let mut __struct = Self::default();
31855 __struct.tc1 = buf.get_i64_le();
31856 __struct.ts1 = buf.get_i64_le();
31857 __struct.target_system = buf.get_u8();
31858 __struct.target_component = buf.get_u8();
31859 Ok(__struct)
31860 }
31861 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31862 let mut __tmp = BytesMut::new(bytes);
31863 #[allow(clippy::absurd_extreme_comparisons)]
31864 #[allow(unused_comparisons)]
31865 if __tmp.remaining() < Self::ENCODED_LEN {
31866 panic!(
31867 "buffer is too small (need {} bytes, but got {})",
31868 Self::ENCODED_LEN,
31869 __tmp.remaining(),
31870 )
31871 }
31872 __tmp.put_i64_le(self.tc1);
31873 __tmp.put_i64_le(self.ts1);
31874 if matches!(version, MavlinkVersion::V2) {
31875 __tmp.put_u8(self.target_system);
31876 __tmp.put_u8(self.target_component);
31877 let len = __tmp.len();
31878 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31879 } else {
31880 __tmp.len()
31881 }
31882 }
31883}
31884#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
31885#[doc = ""]
31886#[doc = "ID: 380"]
31887#[derive(Debug, Clone, PartialEq)]
31888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31889#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31890#[cfg_attr(feature = "ts", derive(TS))]
31891#[cfg_attr(feature = "ts", ts(export))]
31892pub struct TIME_ESTIMATE_TO_TARGET_DATA {
31893 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
31894 pub safe_return: i32,
31895 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
31896 pub land: i32,
31897 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
31898 pub mission_next_item: i32,
31899 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
31900 pub mission_end: i32,
31901 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
31902 pub commanded_action: i32,
31903}
31904impl TIME_ESTIMATE_TO_TARGET_DATA {
31905 pub const ENCODED_LEN: usize = 20usize;
31906 pub const DEFAULT: Self = Self {
31907 safe_return: 0_i32,
31908 land: 0_i32,
31909 mission_next_item: 0_i32,
31910 mission_end: 0_i32,
31911 commanded_action: 0_i32,
31912 };
31913 #[cfg(feature = "arbitrary")]
31914 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31915 use arbitrary::{Arbitrary, Unstructured};
31916 let mut buf = [0u8; 1024];
31917 rng.fill_bytes(&mut buf);
31918 let mut unstructured = Unstructured::new(&buf);
31919 Self::arbitrary(&mut unstructured).unwrap_or_default()
31920 }
31921}
31922impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
31923 fn default() -> Self {
31924 Self::DEFAULT.clone()
31925 }
31926}
31927impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
31928 type Message = MavMessage;
31929 const ID: u32 = 380u32;
31930 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
31931 const EXTRA_CRC: u8 = 232u8;
31932 const ENCODED_LEN: usize = 20usize;
31933 fn deser(
31934 _version: MavlinkVersion,
31935 __input: &[u8],
31936 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31937 let avail_len = __input.len();
31938 let mut payload_buf = [0; Self::ENCODED_LEN];
31939 let mut buf = if avail_len < Self::ENCODED_LEN {
31940 payload_buf[0..avail_len].copy_from_slice(__input);
31941 Bytes::new(&payload_buf)
31942 } else {
31943 Bytes::new(__input)
31944 };
31945 let mut __struct = Self::default();
31946 __struct.safe_return = buf.get_i32_le();
31947 __struct.land = buf.get_i32_le();
31948 __struct.mission_next_item = buf.get_i32_le();
31949 __struct.mission_end = buf.get_i32_le();
31950 __struct.commanded_action = buf.get_i32_le();
31951 Ok(__struct)
31952 }
31953 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31954 let mut __tmp = BytesMut::new(bytes);
31955 #[allow(clippy::absurd_extreme_comparisons)]
31956 #[allow(unused_comparisons)]
31957 if __tmp.remaining() < Self::ENCODED_LEN {
31958 panic!(
31959 "buffer is too small (need {} bytes, but got {})",
31960 Self::ENCODED_LEN,
31961 __tmp.remaining(),
31962 )
31963 }
31964 __tmp.put_i32_le(self.safe_return);
31965 __tmp.put_i32_le(self.land);
31966 __tmp.put_i32_le(self.mission_next_item);
31967 __tmp.put_i32_le(self.mission_end);
31968 __tmp.put_i32_le(self.commanded_action);
31969 if matches!(version, MavlinkVersion::V2) {
31970 let len = __tmp.len();
31971 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31972 } else {
31973 __tmp.len()
31974 }
31975 }
31976}
31977#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
31978#[doc = ""]
31979#[doc = "ID: 333"]
31980#[derive(Debug, Clone, PartialEq)]
31981#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31982#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31983#[cfg_attr(feature = "ts", derive(TS))]
31984#[cfg_attr(feature = "ts", ts(export))]
31985pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
31986 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31987 pub time_usec: u64,
31988 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
31989 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31990 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31991 pub pos_x: [f32; 5],
31992 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
31993 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31994 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31995 pub pos_y: [f32; 5],
31996 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
31997 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31998 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31999 pub pos_z: [f32; 5],
32000 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
32001 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32002 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32003 pub delta: [f32; 5],
32004 #[doc = "Yaw. Set to NaN for unchanged"]
32005 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32006 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32007 pub pos_yaw: [f32; 5],
32008 #[doc = "Number of valid control points (up-to 5 points are possible)"]
32009 pub valid_points: u8,
32010}
32011impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
32012 pub const ENCODED_LEN: usize = 109usize;
32013 pub const DEFAULT: Self = Self {
32014 time_usec: 0_u64,
32015 pos_x: [0.0_f32; 5usize],
32016 pos_y: [0.0_f32; 5usize],
32017 pos_z: [0.0_f32; 5usize],
32018 delta: [0.0_f32; 5usize],
32019 pos_yaw: [0.0_f32; 5usize],
32020 valid_points: 0_u8,
32021 };
32022 #[cfg(feature = "arbitrary")]
32023 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32024 use arbitrary::{Arbitrary, Unstructured};
32025 let mut buf = [0u8; 1024];
32026 rng.fill_bytes(&mut buf);
32027 let mut unstructured = Unstructured::new(&buf);
32028 Self::arbitrary(&mut unstructured).unwrap_or_default()
32029 }
32030}
32031impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
32032 fn default() -> Self {
32033 Self::DEFAULT.clone()
32034 }
32035}
32036impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
32037 type Message = MavMessage;
32038 const ID: u32 = 333u32;
32039 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
32040 const EXTRA_CRC: u8 = 231u8;
32041 const ENCODED_LEN: usize = 109usize;
32042 fn deser(
32043 _version: MavlinkVersion,
32044 __input: &[u8],
32045 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32046 let avail_len = __input.len();
32047 let mut payload_buf = [0; Self::ENCODED_LEN];
32048 let mut buf = if avail_len < Self::ENCODED_LEN {
32049 payload_buf[0..avail_len].copy_from_slice(__input);
32050 Bytes::new(&payload_buf)
32051 } else {
32052 Bytes::new(__input)
32053 };
32054 let mut __struct = Self::default();
32055 __struct.time_usec = buf.get_u64_le();
32056 for v in &mut __struct.pos_x {
32057 let val = buf.get_f32_le();
32058 *v = val;
32059 }
32060 for v in &mut __struct.pos_y {
32061 let val = buf.get_f32_le();
32062 *v = val;
32063 }
32064 for v in &mut __struct.pos_z {
32065 let val = buf.get_f32_le();
32066 *v = val;
32067 }
32068 for v in &mut __struct.delta {
32069 let val = buf.get_f32_le();
32070 *v = val;
32071 }
32072 for v in &mut __struct.pos_yaw {
32073 let val = buf.get_f32_le();
32074 *v = val;
32075 }
32076 __struct.valid_points = buf.get_u8();
32077 Ok(__struct)
32078 }
32079 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32080 let mut __tmp = BytesMut::new(bytes);
32081 #[allow(clippy::absurd_extreme_comparisons)]
32082 #[allow(unused_comparisons)]
32083 if __tmp.remaining() < Self::ENCODED_LEN {
32084 panic!(
32085 "buffer is too small (need {} bytes, but got {})",
32086 Self::ENCODED_LEN,
32087 __tmp.remaining(),
32088 )
32089 }
32090 __tmp.put_u64_le(self.time_usec);
32091 for val in &self.pos_x {
32092 __tmp.put_f32_le(*val);
32093 }
32094 for val in &self.pos_y {
32095 __tmp.put_f32_le(*val);
32096 }
32097 for val in &self.pos_z {
32098 __tmp.put_f32_le(*val);
32099 }
32100 for val in &self.delta {
32101 __tmp.put_f32_le(*val);
32102 }
32103 for val in &self.pos_yaw {
32104 __tmp.put_f32_le(*val);
32105 }
32106 __tmp.put_u8(self.valid_points);
32107 if matches!(version, MavlinkVersion::V2) {
32108 let len = __tmp.len();
32109 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32110 } else {
32111 __tmp.len()
32112 }
32113 }
32114}
32115#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
32116#[doc = ""]
32117#[doc = "ID: 332"]
32118#[derive(Debug, Clone, PartialEq)]
32119#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32120#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32121#[cfg_attr(feature = "ts", derive(TS))]
32122#[cfg_attr(feature = "ts", ts(export))]
32123pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
32124 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32125 pub time_usec: u64,
32126 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
32127 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32128 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32129 pub pos_x: [f32; 5],
32130 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
32131 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32132 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32133 pub pos_y: [f32; 5],
32134 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
32135 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32136 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32137 pub pos_z: [f32; 5],
32138 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
32139 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32140 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32141 pub vel_x: [f32; 5],
32142 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
32143 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32144 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32145 pub vel_y: [f32; 5],
32146 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
32147 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32148 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32149 pub vel_z: [f32; 5],
32150 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
32151 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32152 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32153 pub acc_x: [f32; 5],
32154 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
32155 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32156 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32157 pub acc_y: [f32; 5],
32158 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
32159 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32160 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32161 pub acc_z: [f32; 5],
32162 #[doc = "Yaw angle, set to NaN if not being used"]
32163 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32164 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32165 pub pos_yaw: [f32; 5],
32166 #[doc = "Yaw rate, set to NaN if not being used"]
32167 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32168 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32169 pub vel_yaw: [f32; 5],
32170 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
32171 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32172 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32173 pub command: [u16; 5],
32174 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
32175 pub valid_points: u8,
32176}
32177impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
32178 pub const ENCODED_LEN: usize = 239usize;
32179 pub const DEFAULT: Self = Self {
32180 time_usec: 0_u64,
32181 pos_x: [0.0_f32; 5usize],
32182 pos_y: [0.0_f32; 5usize],
32183 pos_z: [0.0_f32; 5usize],
32184 vel_x: [0.0_f32; 5usize],
32185 vel_y: [0.0_f32; 5usize],
32186 vel_z: [0.0_f32; 5usize],
32187 acc_x: [0.0_f32; 5usize],
32188 acc_y: [0.0_f32; 5usize],
32189 acc_z: [0.0_f32; 5usize],
32190 pos_yaw: [0.0_f32; 5usize],
32191 vel_yaw: [0.0_f32; 5usize],
32192 command: [0_u16; 5usize],
32193 valid_points: 0_u8,
32194 };
32195 #[cfg(feature = "arbitrary")]
32196 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32197 use arbitrary::{Arbitrary, Unstructured};
32198 let mut buf = [0u8; 1024];
32199 rng.fill_bytes(&mut buf);
32200 let mut unstructured = Unstructured::new(&buf);
32201 Self::arbitrary(&mut unstructured).unwrap_or_default()
32202 }
32203}
32204impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
32205 fn default() -> Self {
32206 Self::DEFAULT.clone()
32207 }
32208}
32209impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
32210 type Message = MavMessage;
32211 const ID: u32 = 332u32;
32212 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
32213 const EXTRA_CRC: u8 = 236u8;
32214 const ENCODED_LEN: usize = 239usize;
32215 fn deser(
32216 _version: MavlinkVersion,
32217 __input: &[u8],
32218 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32219 let avail_len = __input.len();
32220 let mut payload_buf = [0; Self::ENCODED_LEN];
32221 let mut buf = if avail_len < Self::ENCODED_LEN {
32222 payload_buf[0..avail_len].copy_from_slice(__input);
32223 Bytes::new(&payload_buf)
32224 } else {
32225 Bytes::new(__input)
32226 };
32227 let mut __struct = Self::default();
32228 __struct.time_usec = buf.get_u64_le();
32229 for v in &mut __struct.pos_x {
32230 let val = buf.get_f32_le();
32231 *v = val;
32232 }
32233 for v in &mut __struct.pos_y {
32234 let val = buf.get_f32_le();
32235 *v = val;
32236 }
32237 for v in &mut __struct.pos_z {
32238 let val = buf.get_f32_le();
32239 *v = val;
32240 }
32241 for v in &mut __struct.vel_x {
32242 let val = buf.get_f32_le();
32243 *v = val;
32244 }
32245 for v in &mut __struct.vel_y {
32246 let val = buf.get_f32_le();
32247 *v = val;
32248 }
32249 for v in &mut __struct.vel_z {
32250 let val = buf.get_f32_le();
32251 *v = val;
32252 }
32253 for v in &mut __struct.acc_x {
32254 let val = buf.get_f32_le();
32255 *v = val;
32256 }
32257 for v in &mut __struct.acc_y {
32258 let val = buf.get_f32_le();
32259 *v = val;
32260 }
32261 for v in &mut __struct.acc_z {
32262 let val = buf.get_f32_le();
32263 *v = val;
32264 }
32265 for v in &mut __struct.pos_yaw {
32266 let val = buf.get_f32_le();
32267 *v = val;
32268 }
32269 for v in &mut __struct.vel_yaw {
32270 let val = buf.get_f32_le();
32271 *v = val;
32272 }
32273 for v in &mut __struct.command {
32274 let val = buf.get_u16_le();
32275 *v = val;
32276 }
32277 __struct.valid_points = buf.get_u8();
32278 Ok(__struct)
32279 }
32280 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32281 let mut __tmp = BytesMut::new(bytes);
32282 #[allow(clippy::absurd_extreme_comparisons)]
32283 #[allow(unused_comparisons)]
32284 if __tmp.remaining() < Self::ENCODED_LEN {
32285 panic!(
32286 "buffer is too small (need {} bytes, but got {})",
32287 Self::ENCODED_LEN,
32288 __tmp.remaining(),
32289 )
32290 }
32291 __tmp.put_u64_le(self.time_usec);
32292 for val in &self.pos_x {
32293 __tmp.put_f32_le(*val);
32294 }
32295 for val in &self.pos_y {
32296 __tmp.put_f32_le(*val);
32297 }
32298 for val in &self.pos_z {
32299 __tmp.put_f32_le(*val);
32300 }
32301 for val in &self.vel_x {
32302 __tmp.put_f32_le(*val);
32303 }
32304 for val in &self.vel_y {
32305 __tmp.put_f32_le(*val);
32306 }
32307 for val in &self.vel_z {
32308 __tmp.put_f32_le(*val);
32309 }
32310 for val in &self.acc_x {
32311 __tmp.put_f32_le(*val);
32312 }
32313 for val in &self.acc_y {
32314 __tmp.put_f32_le(*val);
32315 }
32316 for val in &self.acc_z {
32317 __tmp.put_f32_le(*val);
32318 }
32319 for val in &self.pos_yaw {
32320 __tmp.put_f32_le(*val);
32321 }
32322 for val in &self.vel_yaw {
32323 __tmp.put_f32_le(*val);
32324 }
32325 for val in &self.command {
32326 __tmp.put_u16_le(*val);
32327 }
32328 __tmp.put_u8(self.valid_points);
32329 if matches!(version, MavlinkVersion::V2) {
32330 let len = __tmp.len();
32331 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32332 } else {
32333 __tmp.len()
32334 }
32335 }
32336}
32337#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
32338#[doc = ""]
32339#[doc = "ID: 385"]
32340#[derive(Debug, Clone, PartialEq)]
32341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32343#[cfg_attr(feature = "ts", derive(TS))]
32344#[cfg_attr(feature = "ts", ts(export))]
32345pub struct TUNNEL_DATA {
32346 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
32347 pub payload_type: MavTunnelPayloadType,
32348 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
32349 pub target_system: u8,
32350 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
32351 pub target_component: u8,
32352 #[doc = "Length of the data transported in payload"]
32353 pub payload_length: u8,
32354 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
32355 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32356 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32357 pub payload: [u8; 128],
32358}
32359impl TUNNEL_DATA {
32360 pub const ENCODED_LEN: usize = 133usize;
32361 pub const DEFAULT: Self = Self {
32362 payload_type: MavTunnelPayloadType::DEFAULT,
32363 target_system: 0_u8,
32364 target_component: 0_u8,
32365 payload_length: 0_u8,
32366 payload: [0_u8; 128usize],
32367 };
32368 #[cfg(feature = "arbitrary")]
32369 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32370 use arbitrary::{Arbitrary, Unstructured};
32371 let mut buf = [0u8; 1024];
32372 rng.fill_bytes(&mut buf);
32373 let mut unstructured = Unstructured::new(&buf);
32374 Self::arbitrary(&mut unstructured).unwrap_or_default()
32375 }
32376}
32377impl Default for TUNNEL_DATA {
32378 fn default() -> Self {
32379 Self::DEFAULT.clone()
32380 }
32381}
32382impl MessageData for TUNNEL_DATA {
32383 type Message = MavMessage;
32384 const ID: u32 = 385u32;
32385 const NAME: &'static str = "TUNNEL";
32386 const EXTRA_CRC: u8 = 147u8;
32387 const ENCODED_LEN: usize = 133usize;
32388 fn deser(
32389 _version: MavlinkVersion,
32390 __input: &[u8],
32391 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32392 let avail_len = __input.len();
32393 let mut payload_buf = [0; Self::ENCODED_LEN];
32394 let mut buf = if avail_len < Self::ENCODED_LEN {
32395 payload_buf[0..avail_len].copy_from_slice(__input);
32396 Bytes::new(&payload_buf)
32397 } else {
32398 Bytes::new(__input)
32399 };
32400 let mut __struct = Self::default();
32401 let tmp = buf.get_u16_le();
32402 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
32403 ::mavlink_core::error::ParserError::InvalidEnum {
32404 enum_type: "MavTunnelPayloadType",
32405 value: tmp as u32,
32406 },
32407 )?;
32408 __struct.target_system = buf.get_u8();
32409 __struct.target_component = buf.get_u8();
32410 __struct.payload_length = buf.get_u8();
32411 for v in &mut __struct.payload {
32412 let val = buf.get_u8();
32413 *v = val;
32414 }
32415 Ok(__struct)
32416 }
32417 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32418 let mut __tmp = BytesMut::new(bytes);
32419 #[allow(clippy::absurd_extreme_comparisons)]
32420 #[allow(unused_comparisons)]
32421 if __tmp.remaining() < Self::ENCODED_LEN {
32422 panic!(
32423 "buffer is too small (need {} bytes, but got {})",
32424 Self::ENCODED_LEN,
32425 __tmp.remaining(),
32426 )
32427 }
32428 __tmp.put_u16_le(self.payload_type as u16);
32429 __tmp.put_u8(self.target_system);
32430 __tmp.put_u8(self.target_component);
32431 __tmp.put_u8(self.payload_length);
32432 for val in &self.payload {
32433 __tmp.put_u8(*val);
32434 }
32435 if matches!(version, MavlinkVersion::V2) {
32436 let len = __tmp.len();
32437 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32438 } else {
32439 __tmp.len()
32440 }
32441 }
32442}
32443#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
32444#[doc = ""]
32445#[doc = "ID: 311"]
32446#[derive(Debug, Clone, PartialEq)]
32447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32448#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32449#[cfg_attr(feature = "ts", derive(TS))]
32450#[cfg_attr(feature = "ts", ts(export))]
32451pub struct UAVCAN_NODE_INFO_DATA {
32452 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32453 pub time_usec: u64,
32454 #[doc = "Time since the start-up of the node."]
32455 pub uptime_sec: u32,
32456 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
32457 pub sw_vcs_commit: u32,
32458 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
32459 #[cfg_attr(feature = "ts", ts(type = "string"))]
32460 pub name: CharArray<80>,
32461 #[doc = "Hardware major version number."]
32462 pub hw_version_major: u8,
32463 #[doc = "Hardware minor version number."]
32464 pub hw_version_minor: u8,
32465 #[doc = "Hardware unique 128-bit ID."]
32466 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32467 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32468 pub hw_unique_id: [u8; 16],
32469 #[doc = "Software major version number."]
32470 pub sw_version_major: u8,
32471 #[doc = "Software minor version number."]
32472 pub sw_version_minor: u8,
32473}
32474impl UAVCAN_NODE_INFO_DATA {
32475 pub const ENCODED_LEN: usize = 116usize;
32476 pub const DEFAULT: Self = Self {
32477 time_usec: 0_u64,
32478 uptime_sec: 0_u32,
32479 sw_vcs_commit: 0_u32,
32480 name: CharArray::new([0_u8; 80usize]),
32481 hw_version_major: 0_u8,
32482 hw_version_minor: 0_u8,
32483 hw_unique_id: [0_u8; 16usize],
32484 sw_version_major: 0_u8,
32485 sw_version_minor: 0_u8,
32486 };
32487 #[cfg(feature = "arbitrary")]
32488 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32489 use arbitrary::{Arbitrary, Unstructured};
32490 let mut buf = [0u8; 1024];
32491 rng.fill_bytes(&mut buf);
32492 let mut unstructured = Unstructured::new(&buf);
32493 Self::arbitrary(&mut unstructured).unwrap_or_default()
32494 }
32495}
32496impl Default for UAVCAN_NODE_INFO_DATA {
32497 fn default() -> Self {
32498 Self::DEFAULT.clone()
32499 }
32500}
32501impl MessageData for UAVCAN_NODE_INFO_DATA {
32502 type Message = MavMessage;
32503 const ID: u32 = 311u32;
32504 const NAME: &'static str = "UAVCAN_NODE_INFO";
32505 const EXTRA_CRC: u8 = 95u8;
32506 const ENCODED_LEN: usize = 116usize;
32507 fn deser(
32508 _version: MavlinkVersion,
32509 __input: &[u8],
32510 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32511 let avail_len = __input.len();
32512 let mut payload_buf = [0; Self::ENCODED_LEN];
32513 let mut buf = if avail_len < Self::ENCODED_LEN {
32514 payload_buf[0..avail_len].copy_from_slice(__input);
32515 Bytes::new(&payload_buf)
32516 } else {
32517 Bytes::new(__input)
32518 };
32519 let mut __struct = Self::default();
32520 __struct.time_usec = buf.get_u64_le();
32521 __struct.uptime_sec = buf.get_u32_le();
32522 __struct.sw_vcs_commit = buf.get_u32_le();
32523 let mut tmp = [0_u8; 80usize];
32524 for v in &mut tmp {
32525 *v = buf.get_u8();
32526 }
32527 __struct.name = CharArray::new(tmp);
32528 __struct.hw_version_major = buf.get_u8();
32529 __struct.hw_version_minor = buf.get_u8();
32530 for v in &mut __struct.hw_unique_id {
32531 let val = buf.get_u8();
32532 *v = val;
32533 }
32534 __struct.sw_version_major = buf.get_u8();
32535 __struct.sw_version_minor = buf.get_u8();
32536 Ok(__struct)
32537 }
32538 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32539 let mut __tmp = BytesMut::new(bytes);
32540 #[allow(clippy::absurd_extreme_comparisons)]
32541 #[allow(unused_comparisons)]
32542 if __tmp.remaining() < Self::ENCODED_LEN {
32543 panic!(
32544 "buffer is too small (need {} bytes, but got {})",
32545 Self::ENCODED_LEN,
32546 __tmp.remaining(),
32547 )
32548 }
32549 __tmp.put_u64_le(self.time_usec);
32550 __tmp.put_u32_le(self.uptime_sec);
32551 __tmp.put_u32_le(self.sw_vcs_commit);
32552 for val in &self.name {
32553 __tmp.put_u8(*val);
32554 }
32555 __tmp.put_u8(self.hw_version_major);
32556 __tmp.put_u8(self.hw_version_minor);
32557 for val in &self.hw_unique_id {
32558 __tmp.put_u8(*val);
32559 }
32560 __tmp.put_u8(self.sw_version_major);
32561 __tmp.put_u8(self.sw_version_minor);
32562 if matches!(version, MavlinkVersion::V2) {
32563 let len = __tmp.len();
32564 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32565 } else {
32566 __tmp.len()
32567 }
32568 }
32569}
32570#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
32571#[doc = ""]
32572#[doc = "ID: 310"]
32573#[derive(Debug, Clone, PartialEq)]
32574#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32575#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32576#[cfg_attr(feature = "ts", derive(TS))]
32577#[cfg_attr(feature = "ts", ts(export))]
32578pub struct UAVCAN_NODE_STATUS_DATA {
32579 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32580 pub time_usec: u64,
32581 #[doc = "Time since the start-up of the node."]
32582 pub uptime_sec: u32,
32583 #[doc = "Vendor-specific status information."]
32584 pub vendor_specific_status_code: u16,
32585 #[doc = "Generalized node health status."]
32586 pub health: UavcanNodeHealth,
32587 #[doc = "Generalized operating mode."]
32588 pub mode: UavcanNodeMode,
32589 #[doc = "Not used currently."]
32590 pub sub_mode: u8,
32591}
32592impl UAVCAN_NODE_STATUS_DATA {
32593 pub const ENCODED_LEN: usize = 17usize;
32594 pub const DEFAULT: Self = Self {
32595 time_usec: 0_u64,
32596 uptime_sec: 0_u32,
32597 vendor_specific_status_code: 0_u16,
32598 health: UavcanNodeHealth::DEFAULT,
32599 mode: UavcanNodeMode::DEFAULT,
32600 sub_mode: 0_u8,
32601 };
32602 #[cfg(feature = "arbitrary")]
32603 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32604 use arbitrary::{Arbitrary, Unstructured};
32605 let mut buf = [0u8; 1024];
32606 rng.fill_bytes(&mut buf);
32607 let mut unstructured = Unstructured::new(&buf);
32608 Self::arbitrary(&mut unstructured).unwrap_or_default()
32609 }
32610}
32611impl Default for UAVCAN_NODE_STATUS_DATA {
32612 fn default() -> Self {
32613 Self::DEFAULT.clone()
32614 }
32615}
32616impl MessageData for UAVCAN_NODE_STATUS_DATA {
32617 type Message = MavMessage;
32618 const ID: u32 = 310u32;
32619 const NAME: &'static str = "UAVCAN_NODE_STATUS";
32620 const EXTRA_CRC: u8 = 28u8;
32621 const ENCODED_LEN: usize = 17usize;
32622 fn deser(
32623 _version: MavlinkVersion,
32624 __input: &[u8],
32625 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32626 let avail_len = __input.len();
32627 let mut payload_buf = [0; Self::ENCODED_LEN];
32628 let mut buf = if avail_len < Self::ENCODED_LEN {
32629 payload_buf[0..avail_len].copy_from_slice(__input);
32630 Bytes::new(&payload_buf)
32631 } else {
32632 Bytes::new(__input)
32633 };
32634 let mut __struct = Self::default();
32635 __struct.time_usec = buf.get_u64_le();
32636 __struct.uptime_sec = buf.get_u32_le();
32637 __struct.vendor_specific_status_code = buf.get_u16_le();
32638 let tmp = buf.get_u8();
32639 __struct.health =
32640 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32641 enum_type: "UavcanNodeHealth",
32642 value: tmp as u32,
32643 })?;
32644 let tmp = buf.get_u8();
32645 __struct.mode =
32646 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32647 enum_type: "UavcanNodeMode",
32648 value: tmp as u32,
32649 })?;
32650 __struct.sub_mode = buf.get_u8();
32651 Ok(__struct)
32652 }
32653 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32654 let mut __tmp = BytesMut::new(bytes);
32655 #[allow(clippy::absurd_extreme_comparisons)]
32656 #[allow(unused_comparisons)]
32657 if __tmp.remaining() < Self::ENCODED_LEN {
32658 panic!(
32659 "buffer is too small (need {} bytes, but got {})",
32660 Self::ENCODED_LEN,
32661 __tmp.remaining(),
32662 )
32663 }
32664 __tmp.put_u64_le(self.time_usec);
32665 __tmp.put_u32_le(self.uptime_sec);
32666 __tmp.put_u16_le(self.vendor_specific_status_code);
32667 __tmp.put_u8(self.health as u8);
32668 __tmp.put_u8(self.mode as u8);
32669 __tmp.put_u8(self.sub_mode);
32670 if matches!(version, MavlinkVersion::V2) {
32671 let len = __tmp.len();
32672 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32673 } else {
32674 __tmp.len()
32675 }
32676 }
32677}
32678#[doc = "The global position resulting from GPS and sensor fusion."]
32679#[doc = ""]
32680#[doc = "ID: 340"]
32681#[derive(Debug, Clone, PartialEq)]
32682#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32683#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32684#[cfg_attr(feature = "ts", derive(TS))]
32685#[cfg_attr(feature = "ts", ts(export))]
32686pub struct UTM_GLOBAL_POSITION_DATA {
32687 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
32688 pub time: u64,
32689 #[doc = "Latitude (WGS84)"]
32690 pub lat: i32,
32691 #[doc = "Longitude (WGS84)"]
32692 pub lon: i32,
32693 #[doc = "Altitude (WGS84)"]
32694 pub alt: i32,
32695 #[doc = "Altitude above ground"]
32696 pub relative_alt: i32,
32697 #[doc = "Next waypoint, latitude (WGS84)"]
32698 pub next_lat: i32,
32699 #[doc = "Next waypoint, longitude (WGS84)"]
32700 pub next_lon: i32,
32701 #[doc = "Next waypoint, altitude (WGS84)"]
32702 pub next_alt: i32,
32703 #[doc = "Ground X speed (latitude, positive north)"]
32704 pub vx: i16,
32705 #[doc = "Ground Y speed (longitude, positive east)"]
32706 pub vy: i16,
32707 #[doc = "Ground Z speed (altitude, positive down)"]
32708 pub vz: i16,
32709 #[doc = "Horizontal position uncertainty (standard deviation)"]
32710 pub h_acc: u16,
32711 #[doc = "Altitude uncertainty (standard deviation)"]
32712 pub v_acc: u16,
32713 #[doc = "Speed uncertainty (standard deviation)"]
32714 pub vel_acc: u16,
32715 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
32716 pub update_rate: u16,
32717 #[doc = "Unique UAS ID."]
32718 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32719 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32720 pub uas_id: [u8; 18],
32721 #[doc = "Flight state"]
32722 pub flight_state: UtmFlightState,
32723 #[doc = "Bitwise OR combination of the data available flags."]
32724 pub flags: UtmDataAvailFlags,
32725}
32726impl UTM_GLOBAL_POSITION_DATA {
32727 pub const ENCODED_LEN: usize = 70usize;
32728 pub const DEFAULT: Self = Self {
32729 time: 0_u64,
32730 lat: 0_i32,
32731 lon: 0_i32,
32732 alt: 0_i32,
32733 relative_alt: 0_i32,
32734 next_lat: 0_i32,
32735 next_lon: 0_i32,
32736 next_alt: 0_i32,
32737 vx: 0_i16,
32738 vy: 0_i16,
32739 vz: 0_i16,
32740 h_acc: 0_u16,
32741 v_acc: 0_u16,
32742 vel_acc: 0_u16,
32743 update_rate: 0_u16,
32744 uas_id: [0_u8; 18usize],
32745 flight_state: UtmFlightState::DEFAULT,
32746 flags: UtmDataAvailFlags::DEFAULT,
32747 };
32748 #[cfg(feature = "arbitrary")]
32749 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32750 use arbitrary::{Arbitrary, Unstructured};
32751 let mut buf = [0u8; 1024];
32752 rng.fill_bytes(&mut buf);
32753 let mut unstructured = Unstructured::new(&buf);
32754 Self::arbitrary(&mut unstructured).unwrap_or_default()
32755 }
32756}
32757impl Default for UTM_GLOBAL_POSITION_DATA {
32758 fn default() -> Self {
32759 Self::DEFAULT.clone()
32760 }
32761}
32762impl MessageData for UTM_GLOBAL_POSITION_DATA {
32763 type Message = MavMessage;
32764 const ID: u32 = 340u32;
32765 const NAME: &'static str = "UTM_GLOBAL_POSITION";
32766 const EXTRA_CRC: u8 = 99u8;
32767 const ENCODED_LEN: usize = 70usize;
32768 fn deser(
32769 _version: MavlinkVersion,
32770 __input: &[u8],
32771 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32772 let avail_len = __input.len();
32773 let mut payload_buf = [0; Self::ENCODED_LEN];
32774 let mut buf = if avail_len < Self::ENCODED_LEN {
32775 payload_buf[0..avail_len].copy_from_slice(__input);
32776 Bytes::new(&payload_buf)
32777 } else {
32778 Bytes::new(__input)
32779 };
32780 let mut __struct = Self::default();
32781 __struct.time = buf.get_u64_le();
32782 __struct.lat = buf.get_i32_le();
32783 __struct.lon = buf.get_i32_le();
32784 __struct.alt = buf.get_i32_le();
32785 __struct.relative_alt = buf.get_i32_le();
32786 __struct.next_lat = buf.get_i32_le();
32787 __struct.next_lon = buf.get_i32_le();
32788 __struct.next_alt = buf.get_i32_le();
32789 __struct.vx = buf.get_i16_le();
32790 __struct.vy = buf.get_i16_le();
32791 __struct.vz = buf.get_i16_le();
32792 __struct.h_acc = buf.get_u16_le();
32793 __struct.v_acc = buf.get_u16_le();
32794 __struct.vel_acc = buf.get_u16_le();
32795 __struct.update_rate = buf.get_u16_le();
32796 for v in &mut __struct.uas_id {
32797 let val = buf.get_u8();
32798 *v = val;
32799 }
32800 let tmp = buf.get_u8();
32801 __struct.flight_state =
32802 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32803 enum_type: "UtmFlightState",
32804 value: tmp as u32,
32805 })?;
32806 let tmp = buf.get_u8();
32807 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
32808 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32809 flag_type: "UtmDataAvailFlags",
32810 value: tmp as u32,
32811 })?;
32812 Ok(__struct)
32813 }
32814 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32815 let mut __tmp = BytesMut::new(bytes);
32816 #[allow(clippy::absurd_extreme_comparisons)]
32817 #[allow(unused_comparisons)]
32818 if __tmp.remaining() < Self::ENCODED_LEN {
32819 panic!(
32820 "buffer is too small (need {} bytes, but got {})",
32821 Self::ENCODED_LEN,
32822 __tmp.remaining(),
32823 )
32824 }
32825 __tmp.put_u64_le(self.time);
32826 __tmp.put_i32_le(self.lat);
32827 __tmp.put_i32_le(self.lon);
32828 __tmp.put_i32_le(self.alt);
32829 __tmp.put_i32_le(self.relative_alt);
32830 __tmp.put_i32_le(self.next_lat);
32831 __tmp.put_i32_le(self.next_lon);
32832 __tmp.put_i32_le(self.next_alt);
32833 __tmp.put_i16_le(self.vx);
32834 __tmp.put_i16_le(self.vy);
32835 __tmp.put_i16_le(self.vz);
32836 __tmp.put_u16_le(self.h_acc);
32837 __tmp.put_u16_le(self.v_acc);
32838 __tmp.put_u16_le(self.vel_acc);
32839 __tmp.put_u16_le(self.update_rate);
32840 for val in &self.uas_id {
32841 __tmp.put_u8(*val);
32842 }
32843 __tmp.put_u8(self.flight_state as u8);
32844 __tmp.put_u8(self.flags.bits());
32845 if matches!(version, MavlinkVersion::V2) {
32846 let len = __tmp.len();
32847 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32848 } else {
32849 __tmp.len()
32850 }
32851 }
32852}
32853#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
32854#[doc = ""]
32855#[doc = "ID: 248"]
32856#[derive(Debug, Clone, PartialEq)]
32857#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32858#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32859#[cfg_attr(feature = "ts", derive(TS))]
32860#[cfg_attr(feature = "ts", ts(export))]
32861pub struct V2_EXTENSION_DATA {
32862 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
32863 pub message_type: u16,
32864 #[doc = "Network ID (0 for broadcast)"]
32865 pub target_network: u8,
32866 #[doc = "System ID (0 for broadcast)"]
32867 pub target_system: u8,
32868 #[doc = "Component ID (0 for broadcast)"]
32869 pub target_component: u8,
32870 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
32871 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32872 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32873 pub payload: [u8; 249],
32874}
32875impl V2_EXTENSION_DATA {
32876 pub const ENCODED_LEN: usize = 254usize;
32877 pub const DEFAULT: Self = Self {
32878 message_type: 0_u16,
32879 target_network: 0_u8,
32880 target_system: 0_u8,
32881 target_component: 0_u8,
32882 payload: [0_u8; 249usize],
32883 };
32884 #[cfg(feature = "arbitrary")]
32885 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32886 use arbitrary::{Arbitrary, Unstructured};
32887 let mut buf = [0u8; 1024];
32888 rng.fill_bytes(&mut buf);
32889 let mut unstructured = Unstructured::new(&buf);
32890 Self::arbitrary(&mut unstructured).unwrap_or_default()
32891 }
32892}
32893impl Default for V2_EXTENSION_DATA {
32894 fn default() -> Self {
32895 Self::DEFAULT.clone()
32896 }
32897}
32898impl MessageData for V2_EXTENSION_DATA {
32899 type Message = MavMessage;
32900 const ID: u32 = 248u32;
32901 const NAME: &'static str = "V2_EXTENSION";
32902 const EXTRA_CRC: u8 = 8u8;
32903 const ENCODED_LEN: usize = 254usize;
32904 fn deser(
32905 _version: MavlinkVersion,
32906 __input: &[u8],
32907 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32908 let avail_len = __input.len();
32909 let mut payload_buf = [0; Self::ENCODED_LEN];
32910 let mut buf = if avail_len < Self::ENCODED_LEN {
32911 payload_buf[0..avail_len].copy_from_slice(__input);
32912 Bytes::new(&payload_buf)
32913 } else {
32914 Bytes::new(__input)
32915 };
32916 let mut __struct = Self::default();
32917 __struct.message_type = buf.get_u16_le();
32918 __struct.target_network = buf.get_u8();
32919 __struct.target_system = buf.get_u8();
32920 __struct.target_component = buf.get_u8();
32921 for v in &mut __struct.payload {
32922 let val = buf.get_u8();
32923 *v = val;
32924 }
32925 Ok(__struct)
32926 }
32927 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32928 let mut __tmp = BytesMut::new(bytes);
32929 #[allow(clippy::absurd_extreme_comparisons)]
32930 #[allow(unused_comparisons)]
32931 if __tmp.remaining() < Self::ENCODED_LEN {
32932 panic!(
32933 "buffer is too small (need {} bytes, but got {})",
32934 Self::ENCODED_LEN,
32935 __tmp.remaining(),
32936 )
32937 }
32938 __tmp.put_u16_le(self.message_type);
32939 __tmp.put_u8(self.target_network);
32940 __tmp.put_u8(self.target_system);
32941 __tmp.put_u8(self.target_component);
32942 for val in &self.payload {
32943 __tmp.put_u8(*val);
32944 }
32945 if matches!(version, MavlinkVersion::V2) {
32946 let len = __tmp.len();
32947 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32948 } else {
32949 __tmp.len()
32950 }
32951 }
32952}
32953#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
32954#[doc = ""]
32955#[doc = "ID: 74"]
32956#[derive(Debug, Clone, PartialEq)]
32957#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32958#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32959#[cfg_attr(feature = "ts", derive(TS))]
32960#[cfg_attr(feature = "ts", ts(export))]
32961pub struct VFR_HUD_DATA {
32962 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
32963 pub airspeed: f32,
32964 #[doc = "Current ground speed."]
32965 pub groundspeed: f32,
32966 #[doc = "Current altitude (MSL)."]
32967 pub alt: f32,
32968 #[doc = "Current climb rate."]
32969 pub climb: f32,
32970 #[doc = "Current heading in compass units (0-360, 0=north)."]
32971 pub heading: i16,
32972 #[doc = "Current throttle setting (0 to 100)."]
32973 pub throttle: u16,
32974}
32975impl VFR_HUD_DATA {
32976 pub const ENCODED_LEN: usize = 20usize;
32977 pub const DEFAULT: Self = Self {
32978 airspeed: 0.0_f32,
32979 groundspeed: 0.0_f32,
32980 alt: 0.0_f32,
32981 climb: 0.0_f32,
32982 heading: 0_i16,
32983 throttle: 0_u16,
32984 };
32985 #[cfg(feature = "arbitrary")]
32986 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32987 use arbitrary::{Arbitrary, Unstructured};
32988 let mut buf = [0u8; 1024];
32989 rng.fill_bytes(&mut buf);
32990 let mut unstructured = Unstructured::new(&buf);
32991 Self::arbitrary(&mut unstructured).unwrap_or_default()
32992 }
32993}
32994impl Default for VFR_HUD_DATA {
32995 fn default() -> Self {
32996 Self::DEFAULT.clone()
32997 }
32998}
32999impl MessageData for VFR_HUD_DATA {
33000 type Message = MavMessage;
33001 const ID: u32 = 74u32;
33002 const NAME: &'static str = "VFR_HUD";
33003 const EXTRA_CRC: u8 = 20u8;
33004 const ENCODED_LEN: usize = 20usize;
33005 fn deser(
33006 _version: MavlinkVersion,
33007 __input: &[u8],
33008 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33009 let avail_len = __input.len();
33010 let mut payload_buf = [0; Self::ENCODED_LEN];
33011 let mut buf = if avail_len < Self::ENCODED_LEN {
33012 payload_buf[0..avail_len].copy_from_slice(__input);
33013 Bytes::new(&payload_buf)
33014 } else {
33015 Bytes::new(__input)
33016 };
33017 let mut __struct = Self::default();
33018 __struct.airspeed = buf.get_f32_le();
33019 __struct.groundspeed = buf.get_f32_le();
33020 __struct.alt = buf.get_f32_le();
33021 __struct.climb = buf.get_f32_le();
33022 __struct.heading = buf.get_i16_le();
33023 __struct.throttle = buf.get_u16_le();
33024 Ok(__struct)
33025 }
33026 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33027 let mut __tmp = BytesMut::new(bytes);
33028 #[allow(clippy::absurd_extreme_comparisons)]
33029 #[allow(unused_comparisons)]
33030 if __tmp.remaining() < Self::ENCODED_LEN {
33031 panic!(
33032 "buffer is too small (need {} bytes, but got {})",
33033 Self::ENCODED_LEN,
33034 __tmp.remaining(),
33035 )
33036 }
33037 __tmp.put_f32_le(self.airspeed);
33038 __tmp.put_f32_le(self.groundspeed);
33039 __tmp.put_f32_le(self.alt);
33040 __tmp.put_f32_le(self.climb);
33041 __tmp.put_i16_le(self.heading);
33042 __tmp.put_u16_le(self.throttle);
33043 if matches!(version, MavlinkVersion::V2) {
33044 let len = __tmp.len();
33045 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33046 } else {
33047 __tmp.len()
33048 }
33049 }
33050}
33051#[doc = "Vibration levels and accelerometer clipping."]
33052#[doc = ""]
33053#[doc = "ID: 241"]
33054#[derive(Debug, Clone, PartialEq)]
33055#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33056#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33057#[cfg_attr(feature = "ts", derive(TS))]
33058#[cfg_attr(feature = "ts", ts(export))]
33059pub struct VIBRATION_DATA {
33060 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
33061 pub time_usec: u64,
33062 #[doc = "Vibration levels on X-axis"]
33063 pub vibration_x: f32,
33064 #[doc = "Vibration levels on Y-axis"]
33065 pub vibration_y: f32,
33066 #[doc = "Vibration levels on Z-axis"]
33067 pub vibration_z: f32,
33068 #[doc = "first accelerometer clipping count"]
33069 pub clipping_0: u32,
33070 #[doc = "second accelerometer clipping count"]
33071 pub clipping_1: u32,
33072 #[doc = "third accelerometer clipping count"]
33073 pub clipping_2: u32,
33074}
33075impl VIBRATION_DATA {
33076 pub const ENCODED_LEN: usize = 32usize;
33077 pub const DEFAULT: Self = Self {
33078 time_usec: 0_u64,
33079 vibration_x: 0.0_f32,
33080 vibration_y: 0.0_f32,
33081 vibration_z: 0.0_f32,
33082 clipping_0: 0_u32,
33083 clipping_1: 0_u32,
33084 clipping_2: 0_u32,
33085 };
33086 #[cfg(feature = "arbitrary")]
33087 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33088 use arbitrary::{Arbitrary, Unstructured};
33089 let mut buf = [0u8; 1024];
33090 rng.fill_bytes(&mut buf);
33091 let mut unstructured = Unstructured::new(&buf);
33092 Self::arbitrary(&mut unstructured).unwrap_or_default()
33093 }
33094}
33095impl Default for VIBRATION_DATA {
33096 fn default() -> Self {
33097 Self::DEFAULT.clone()
33098 }
33099}
33100impl MessageData for VIBRATION_DATA {
33101 type Message = MavMessage;
33102 const ID: u32 = 241u32;
33103 const NAME: &'static str = "VIBRATION";
33104 const EXTRA_CRC: u8 = 90u8;
33105 const ENCODED_LEN: usize = 32usize;
33106 fn deser(
33107 _version: MavlinkVersion,
33108 __input: &[u8],
33109 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33110 let avail_len = __input.len();
33111 let mut payload_buf = [0; Self::ENCODED_LEN];
33112 let mut buf = if avail_len < Self::ENCODED_LEN {
33113 payload_buf[0..avail_len].copy_from_slice(__input);
33114 Bytes::new(&payload_buf)
33115 } else {
33116 Bytes::new(__input)
33117 };
33118 let mut __struct = Self::default();
33119 __struct.time_usec = buf.get_u64_le();
33120 __struct.vibration_x = buf.get_f32_le();
33121 __struct.vibration_y = buf.get_f32_le();
33122 __struct.vibration_z = buf.get_f32_le();
33123 __struct.clipping_0 = buf.get_u32_le();
33124 __struct.clipping_1 = buf.get_u32_le();
33125 __struct.clipping_2 = buf.get_u32_le();
33126 Ok(__struct)
33127 }
33128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33129 let mut __tmp = BytesMut::new(bytes);
33130 #[allow(clippy::absurd_extreme_comparisons)]
33131 #[allow(unused_comparisons)]
33132 if __tmp.remaining() < Self::ENCODED_LEN {
33133 panic!(
33134 "buffer is too small (need {} bytes, but got {})",
33135 Self::ENCODED_LEN,
33136 __tmp.remaining(),
33137 )
33138 }
33139 __tmp.put_u64_le(self.time_usec);
33140 __tmp.put_f32_le(self.vibration_x);
33141 __tmp.put_f32_le(self.vibration_y);
33142 __tmp.put_f32_le(self.vibration_z);
33143 __tmp.put_u32_le(self.clipping_0);
33144 __tmp.put_u32_le(self.clipping_1);
33145 __tmp.put_u32_le(self.clipping_2);
33146 if matches!(version, MavlinkVersion::V2) {
33147 let len = __tmp.len();
33148 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33149 } else {
33150 __tmp.len()
33151 }
33152 }
33153}
33154#[doc = "Global position estimate from a Vicon motion system source."]
33155#[doc = ""]
33156#[doc = "ID: 104"]
33157#[derive(Debug, Clone, PartialEq)]
33158#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33159#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33160#[cfg_attr(feature = "ts", derive(TS))]
33161#[cfg_attr(feature = "ts", ts(export))]
33162pub struct VICON_POSITION_ESTIMATE_DATA {
33163 #[doc = "Timestamp (UNIX time or time since system boot)"]
33164 pub usec: u64,
33165 #[doc = "Global X position"]
33166 pub x: f32,
33167 #[doc = "Global Y position"]
33168 pub y: f32,
33169 #[doc = "Global Z position"]
33170 pub z: f32,
33171 #[doc = "Roll angle"]
33172 pub roll: f32,
33173 #[doc = "Pitch angle"]
33174 pub pitch: f32,
33175 #[doc = "Yaw angle"]
33176 pub yaw: f32,
33177 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
33178 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33179 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33180 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33181 pub covariance: [f32; 21],
33182}
33183impl VICON_POSITION_ESTIMATE_DATA {
33184 pub const ENCODED_LEN: usize = 116usize;
33185 pub const DEFAULT: Self = Self {
33186 usec: 0_u64,
33187 x: 0.0_f32,
33188 y: 0.0_f32,
33189 z: 0.0_f32,
33190 roll: 0.0_f32,
33191 pitch: 0.0_f32,
33192 yaw: 0.0_f32,
33193 covariance: [0.0_f32; 21usize],
33194 };
33195 #[cfg(feature = "arbitrary")]
33196 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33197 use arbitrary::{Arbitrary, Unstructured};
33198 let mut buf = [0u8; 1024];
33199 rng.fill_bytes(&mut buf);
33200 let mut unstructured = Unstructured::new(&buf);
33201 Self::arbitrary(&mut unstructured).unwrap_or_default()
33202 }
33203}
33204impl Default for VICON_POSITION_ESTIMATE_DATA {
33205 fn default() -> Self {
33206 Self::DEFAULT.clone()
33207 }
33208}
33209impl MessageData for VICON_POSITION_ESTIMATE_DATA {
33210 type Message = MavMessage;
33211 const ID: u32 = 104u32;
33212 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
33213 const EXTRA_CRC: u8 = 56u8;
33214 const ENCODED_LEN: usize = 116usize;
33215 fn deser(
33216 _version: MavlinkVersion,
33217 __input: &[u8],
33218 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33219 let avail_len = __input.len();
33220 let mut payload_buf = [0; Self::ENCODED_LEN];
33221 let mut buf = if avail_len < Self::ENCODED_LEN {
33222 payload_buf[0..avail_len].copy_from_slice(__input);
33223 Bytes::new(&payload_buf)
33224 } else {
33225 Bytes::new(__input)
33226 };
33227 let mut __struct = Self::default();
33228 __struct.usec = buf.get_u64_le();
33229 __struct.x = buf.get_f32_le();
33230 __struct.y = buf.get_f32_le();
33231 __struct.z = buf.get_f32_le();
33232 __struct.roll = buf.get_f32_le();
33233 __struct.pitch = buf.get_f32_le();
33234 __struct.yaw = buf.get_f32_le();
33235 for v in &mut __struct.covariance {
33236 let val = buf.get_f32_le();
33237 *v = val;
33238 }
33239 Ok(__struct)
33240 }
33241 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33242 let mut __tmp = BytesMut::new(bytes);
33243 #[allow(clippy::absurd_extreme_comparisons)]
33244 #[allow(unused_comparisons)]
33245 if __tmp.remaining() < Self::ENCODED_LEN {
33246 panic!(
33247 "buffer is too small (need {} bytes, but got {})",
33248 Self::ENCODED_LEN,
33249 __tmp.remaining(),
33250 )
33251 }
33252 __tmp.put_u64_le(self.usec);
33253 __tmp.put_f32_le(self.x);
33254 __tmp.put_f32_le(self.y);
33255 __tmp.put_f32_le(self.z);
33256 __tmp.put_f32_le(self.roll);
33257 __tmp.put_f32_le(self.pitch);
33258 __tmp.put_f32_le(self.yaw);
33259 if matches!(version, MavlinkVersion::V2) {
33260 for val in &self.covariance {
33261 __tmp.put_f32_le(*val);
33262 }
33263 let len = __tmp.len();
33264 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33265 } else {
33266 __tmp.len()
33267 }
33268 }
33269}
33270#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
33271#[doc = ""]
33272#[doc = "ID: 269"]
33273#[derive(Debug, Clone, PartialEq)]
33274#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33275#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33276#[cfg_attr(feature = "ts", derive(TS))]
33277#[cfg_attr(feature = "ts", ts(export))]
33278pub struct VIDEO_STREAM_INFORMATION_DATA {
33279 #[doc = "Frame rate."]
33280 pub framerate: f32,
33281 #[doc = "Bit rate."]
33282 pub bitrate: u32,
33283 #[doc = "Bitmap of stream status flags."]
33284 pub flags: VideoStreamStatusFlags,
33285 #[doc = "Horizontal resolution."]
33286 pub resolution_h: u16,
33287 #[doc = "Vertical resolution."]
33288 pub resolution_v: u16,
33289 #[doc = "Video image rotation clockwise."]
33290 pub rotation: u16,
33291 #[doc = "Horizontal Field of view."]
33292 pub hfov: u16,
33293 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
33294 pub stream_id: u8,
33295 #[doc = "Number of streams available."]
33296 pub count: u8,
33297 #[doc = "Type of stream."]
33298 pub mavtype: VideoStreamType,
33299 #[doc = "Stream name."]
33300 #[cfg_attr(feature = "ts", ts(type = "string"))]
33301 pub name: CharArray<32>,
33302 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
33303 #[cfg_attr(feature = "ts", ts(type = "string"))]
33304 pub uri: CharArray<160>,
33305 #[doc = "Encoding of stream."]
33306 #[cfg_attr(feature = "serde", serde(default))]
33307 pub encoding: VideoStreamEncoding,
33308 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
33309 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33310 pub camera_device_id: u8,
33311}
33312impl VIDEO_STREAM_INFORMATION_DATA {
33313 pub const ENCODED_LEN: usize = 215usize;
33314 pub const DEFAULT: Self = Self {
33315 framerate: 0.0_f32,
33316 bitrate: 0_u32,
33317 flags: VideoStreamStatusFlags::DEFAULT,
33318 resolution_h: 0_u16,
33319 resolution_v: 0_u16,
33320 rotation: 0_u16,
33321 hfov: 0_u16,
33322 stream_id: 0_u8,
33323 count: 0_u8,
33324 mavtype: VideoStreamType::DEFAULT,
33325 name: CharArray::new([0_u8; 32usize]),
33326 uri: CharArray::new([0_u8; 160usize]),
33327 encoding: VideoStreamEncoding::DEFAULT,
33328 camera_device_id: 0_u8,
33329 };
33330 #[cfg(feature = "arbitrary")]
33331 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33332 use arbitrary::{Arbitrary, Unstructured};
33333 let mut buf = [0u8; 1024];
33334 rng.fill_bytes(&mut buf);
33335 let mut unstructured = Unstructured::new(&buf);
33336 Self::arbitrary(&mut unstructured).unwrap_or_default()
33337 }
33338}
33339impl Default for VIDEO_STREAM_INFORMATION_DATA {
33340 fn default() -> Self {
33341 Self::DEFAULT.clone()
33342 }
33343}
33344impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
33345 type Message = MavMessage;
33346 const ID: u32 = 269u32;
33347 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
33348 const EXTRA_CRC: u8 = 109u8;
33349 const ENCODED_LEN: usize = 215usize;
33350 fn deser(
33351 _version: MavlinkVersion,
33352 __input: &[u8],
33353 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33354 let avail_len = __input.len();
33355 let mut payload_buf = [0; Self::ENCODED_LEN];
33356 let mut buf = if avail_len < Self::ENCODED_LEN {
33357 payload_buf[0..avail_len].copy_from_slice(__input);
33358 Bytes::new(&payload_buf)
33359 } else {
33360 Bytes::new(__input)
33361 };
33362 let mut __struct = Self::default();
33363 __struct.framerate = buf.get_f32_le();
33364 __struct.bitrate = buf.get_u32_le();
33365 let tmp = buf.get_u16_le();
33366 __struct.flags = VideoStreamStatusFlags::from_bits(
33367 tmp & VideoStreamStatusFlags::all().bits(),
33368 )
33369 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
33370 flag_type: "VideoStreamStatusFlags",
33371 value: tmp as u32,
33372 })?;
33373 __struct.resolution_h = buf.get_u16_le();
33374 __struct.resolution_v = buf.get_u16_le();
33375 __struct.rotation = buf.get_u16_le();
33376 __struct.hfov = buf.get_u16_le();
33377 __struct.stream_id = buf.get_u8();
33378 __struct.count = buf.get_u8();
33379 let tmp = buf.get_u8();
33380 __struct.mavtype =
33381 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
33382 enum_type: "VideoStreamType",
33383 value: tmp as u32,
33384 })?;
33385 let mut tmp = [0_u8; 32usize];
33386 for v in &mut tmp {
33387 *v = buf.get_u8();
33388 }
33389 __struct.name = CharArray::new(tmp);
33390 let mut tmp = [0_u8; 160usize];
33391 for v in &mut tmp {
33392 *v = buf.get_u8();
33393 }
33394 __struct.uri = CharArray::new(tmp);
33395 let tmp = buf.get_u8();
33396 __struct.encoding =
33397 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
33398 enum_type: "VideoStreamEncoding",
33399 value: tmp as u32,
33400 })?;
33401 __struct.camera_device_id = buf.get_u8();
33402 Ok(__struct)
33403 }
33404 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33405 let mut __tmp = BytesMut::new(bytes);
33406 #[allow(clippy::absurd_extreme_comparisons)]
33407 #[allow(unused_comparisons)]
33408 if __tmp.remaining() < Self::ENCODED_LEN {
33409 panic!(
33410 "buffer is too small (need {} bytes, but got {})",
33411 Self::ENCODED_LEN,
33412 __tmp.remaining(),
33413 )
33414 }
33415 __tmp.put_f32_le(self.framerate);
33416 __tmp.put_u32_le(self.bitrate);
33417 __tmp.put_u16_le(self.flags.bits());
33418 __tmp.put_u16_le(self.resolution_h);
33419 __tmp.put_u16_le(self.resolution_v);
33420 __tmp.put_u16_le(self.rotation);
33421 __tmp.put_u16_le(self.hfov);
33422 __tmp.put_u8(self.stream_id);
33423 __tmp.put_u8(self.count);
33424 __tmp.put_u8(self.mavtype as u8);
33425 for val in &self.name {
33426 __tmp.put_u8(*val);
33427 }
33428 for val in &self.uri {
33429 __tmp.put_u8(*val);
33430 }
33431 if matches!(version, MavlinkVersion::V2) {
33432 __tmp.put_u8(self.encoding as u8);
33433 __tmp.put_u8(self.camera_device_id);
33434 let len = __tmp.len();
33435 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33436 } else {
33437 __tmp.len()
33438 }
33439 }
33440}
33441#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
33442#[doc = ""]
33443#[doc = "ID: 270"]
33444#[derive(Debug, Clone, PartialEq)]
33445#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33446#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33447#[cfg_attr(feature = "ts", derive(TS))]
33448#[cfg_attr(feature = "ts", ts(export))]
33449pub struct VIDEO_STREAM_STATUS_DATA {
33450 #[doc = "Frame rate"]
33451 pub framerate: f32,
33452 #[doc = "Bit rate"]
33453 pub bitrate: u32,
33454 #[doc = "Bitmap of stream status flags"]
33455 pub flags: VideoStreamStatusFlags,
33456 #[doc = "Horizontal resolution"]
33457 pub resolution_h: u16,
33458 #[doc = "Vertical resolution"]
33459 pub resolution_v: u16,
33460 #[doc = "Video image rotation clockwise"]
33461 pub rotation: u16,
33462 #[doc = "Horizontal Field of view"]
33463 pub hfov: u16,
33464 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
33465 pub stream_id: u8,
33466 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
33467 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33468 pub camera_device_id: u8,
33469}
33470impl VIDEO_STREAM_STATUS_DATA {
33471 pub const ENCODED_LEN: usize = 20usize;
33472 pub const DEFAULT: Self = Self {
33473 framerate: 0.0_f32,
33474 bitrate: 0_u32,
33475 flags: VideoStreamStatusFlags::DEFAULT,
33476 resolution_h: 0_u16,
33477 resolution_v: 0_u16,
33478 rotation: 0_u16,
33479 hfov: 0_u16,
33480 stream_id: 0_u8,
33481 camera_device_id: 0_u8,
33482 };
33483 #[cfg(feature = "arbitrary")]
33484 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33485 use arbitrary::{Arbitrary, Unstructured};
33486 let mut buf = [0u8; 1024];
33487 rng.fill_bytes(&mut buf);
33488 let mut unstructured = Unstructured::new(&buf);
33489 Self::arbitrary(&mut unstructured).unwrap_or_default()
33490 }
33491}
33492impl Default for VIDEO_STREAM_STATUS_DATA {
33493 fn default() -> Self {
33494 Self::DEFAULT.clone()
33495 }
33496}
33497impl MessageData for VIDEO_STREAM_STATUS_DATA {
33498 type Message = MavMessage;
33499 const ID: u32 = 270u32;
33500 const NAME: &'static str = "VIDEO_STREAM_STATUS";
33501 const EXTRA_CRC: u8 = 59u8;
33502 const ENCODED_LEN: usize = 20usize;
33503 fn deser(
33504 _version: MavlinkVersion,
33505 __input: &[u8],
33506 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33507 let avail_len = __input.len();
33508 let mut payload_buf = [0; Self::ENCODED_LEN];
33509 let mut buf = if avail_len < Self::ENCODED_LEN {
33510 payload_buf[0..avail_len].copy_from_slice(__input);
33511 Bytes::new(&payload_buf)
33512 } else {
33513 Bytes::new(__input)
33514 };
33515 let mut __struct = Self::default();
33516 __struct.framerate = buf.get_f32_le();
33517 __struct.bitrate = buf.get_u32_le();
33518 let tmp = buf.get_u16_le();
33519 __struct.flags = VideoStreamStatusFlags::from_bits(
33520 tmp & VideoStreamStatusFlags::all().bits(),
33521 )
33522 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
33523 flag_type: "VideoStreamStatusFlags",
33524 value: tmp as u32,
33525 })?;
33526 __struct.resolution_h = buf.get_u16_le();
33527 __struct.resolution_v = buf.get_u16_le();
33528 __struct.rotation = buf.get_u16_le();
33529 __struct.hfov = buf.get_u16_le();
33530 __struct.stream_id = buf.get_u8();
33531 __struct.camera_device_id = buf.get_u8();
33532 Ok(__struct)
33533 }
33534 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33535 let mut __tmp = BytesMut::new(bytes);
33536 #[allow(clippy::absurd_extreme_comparisons)]
33537 #[allow(unused_comparisons)]
33538 if __tmp.remaining() < Self::ENCODED_LEN {
33539 panic!(
33540 "buffer is too small (need {} bytes, but got {})",
33541 Self::ENCODED_LEN,
33542 __tmp.remaining(),
33543 )
33544 }
33545 __tmp.put_f32_le(self.framerate);
33546 __tmp.put_u32_le(self.bitrate);
33547 __tmp.put_u16_le(self.flags.bits());
33548 __tmp.put_u16_le(self.resolution_h);
33549 __tmp.put_u16_le(self.resolution_v);
33550 __tmp.put_u16_le(self.rotation);
33551 __tmp.put_u16_le(self.hfov);
33552 __tmp.put_u8(self.stream_id);
33553 if matches!(version, MavlinkVersion::V2) {
33554 __tmp.put_u8(self.camera_device_id);
33555 let len = __tmp.len();
33556 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33557 } else {
33558 __tmp.len()
33559 }
33560 }
33561}
33562#[doc = "Local position/attitude estimate from a vision source."]
33563#[doc = ""]
33564#[doc = "ID: 102"]
33565#[derive(Debug, Clone, PartialEq)]
33566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33567#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33568#[cfg_attr(feature = "ts", derive(TS))]
33569#[cfg_attr(feature = "ts", ts(export))]
33570pub struct VISION_POSITION_ESTIMATE_DATA {
33571 #[doc = "Timestamp (UNIX time or time since system boot)"]
33572 pub usec: u64,
33573 #[doc = "Local X position"]
33574 pub x: f32,
33575 #[doc = "Local Y position"]
33576 pub y: f32,
33577 #[doc = "Local Z position"]
33578 pub z: f32,
33579 #[doc = "Roll angle"]
33580 pub roll: f32,
33581 #[doc = "Pitch angle"]
33582 pub pitch: f32,
33583 #[doc = "Yaw angle"]
33584 pub yaw: f32,
33585 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
33586 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33587 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33588 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33589 pub covariance: [f32; 21],
33590 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
33591 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33592 pub reset_counter: u8,
33593}
33594impl VISION_POSITION_ESTIMATE_DATA {
33595 pub const ENCODED_LEN: usize = 117usize;
33596 pub const DEFAULT: Self = Self {
33597 usec: 0_u64,
33598 x: 0.0_f32,
33599 y: 0.0_f32,
33600 z: 0.0_f32,
33601 roll: 0.0_f32,
33602 pitch: 0.0_f32,
33603 yaw: 0.0_f32,
33604 covariance: [0.0_f32; 21usize],
33605 reset_counter: 0_u8,
33606 };
33607 #[cfg(feature = "arbitrary")]
33608 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33609 use arbitrary::{Arbitrary, Unstructured};
33610 let mut buf = [0u8; 1024];
33611 rng.fill_bytes(&mut buf);
33612 let mut unstructured = Unstructured::new(&buf);
33613 Self::arbitrary(&mut unstructured).unwrap_or_default()
33614 }
33615}
33616impl Default for VISION_POSITION_ESTIMATE_DATA {
33617 fn default() -> Self {
33618 Self::DEFAULT.clone()
33619 }
33620}
33621impl MessageData for VISION_POSITION_ESTIMATE_DATA {
33622 type Message = MavMessage;
33623 const ID: u32 = 102u32;
33624 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
33625 const EXTRA_CRC: u8 = 158u8;
33626 const ENCODED_LEN: usize = 117usize;
33627 fn deser(
33628 _version: MavlinkVersion,
33629 __input: &[u8],
33630 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33631 let avail_len = __input.len();
33632 let mut payload_buf = [0; Self::ENCODED_LEN];
33633 let mut buf = if avail_len < Self::ENCODED_LEN {
33634 payload_buf[0..avail_len].copy_from_slice(__input);
33635 Bytes::new(&payload_buf)
33636 } else {
33637 Bytes::new(__input)
33638 };
33639 let mut __struct = Self::default();
33640 __struct.usec = buf.get_u64_le();
33641 __struct.x = buf.get_f32_le();
33642 __struct.y = buf.get_f32_le();
33643 __struct.z = buf.get_f32_le();
33644 __struct.roll = buf.get_f32_le();
33645 __struct.pitch = buf.get_f32_le();
33646 __struct.yaw = buf.get_f32_le();
33647 for v in &mut __struct.covariance {
33648 let val = buf.get_f32_le();
33649 *v = val;
33650 }
33651 __struct.reset_counter = buf.get_u8();
33652 Ok(__struct)
33653 }
33654 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33655 let mut __tmp = BytesMut::new(bytes);
33656 #[allow(clippy::absurd_extreme_comparisons)]
33657 #[allow(unused_comparisons)]
33658 if __tmp.remaining() < Self::ENCODED_LEN {
33659 panic!(
33660 "buffer is too small (need {} bytes, but got {})",
33661 Self::ENCODED_LEN,
33662 __tmp.remaining(),
33663 )
33664 }
33665 __tmp.put_u64_le(self.usec);
33666 __tmp.put_f32_le(self.x);
33667 __tmp.put_f32_le(self.y);
33668 __tmp.put_f32_le(self.z);
33669 __tmp.put_f32_le(self.roll);
33670 __tmp.put_f32_le(self.pitch);
33671 __tmp.put_f32_le(self.yaw);
33672 if matches!(version, MavlinkVersion::V2) {
33673 for val in &self.covariance {
33674 __tmp.put_f32_le(*val);
33675 }
33676 __tmp.put_u8(self.reset_counter);
33677 let len = __tmp.len();
33678 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33679 } else {
33680 __tmp.len()
33681 }
33682 }
33683}
33684#[doc = "Speed estimate from a vision source."]
33685#[doc = ""]
33686#[doc = "ID: 103"]
33687#[derive(Debug, Clone, PartialEq)]
33688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33689#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33690#[cfg_attr(feature = "ts", derive(TS))]
33691#[cfg_attr(feature = "ts", ts(export))]
33692pub struct VISION_SPEED_ESTIMATE_DATA {
33693 #[doc = "Timestamp (UNIX time or time since system boot)"]
33694 pub usec: u64,
33695 #[doc = "Global X speed"]
33696 pub x: f32,
33697 #[doc = "Global Y speed"]
33698 pub y: f32,
33699 #[doc = "Global Z speed"]
33700 pub z: f32,
33701 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
33702 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33703 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33704 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33705 pub covariance: [f32; 9],
33706 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
33707 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33708 pub reset_counter: u8,
33709}
33710impl VISION_SPEED_ESTIMATE_DATA {
33711 pub const ENCODED_LEN: usize = 57usize;
33712 pub const DEFAULT: Self = Self {
33713 usec: 0_u64,
33714 x: 0.0_f32,
33715 y: 0.0_f32,
33716 z: 0.0_f32,
33717 covariance: [0.0_f32; 9usize],
33718 reset_counter: 0_u8,
33719 };
33720 #[cfg(feature = "arbitrary")]
33721 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33722 use arbitrary::{Arbitrary, Unstructured};
33723 let mut buf = [0u8; 1024];
33724 rng.fill_bytes(&mut buf);
33725 let mut unstructured = Unstructured::new(&buf);
33726 Self::arbitrary(&mut unstructured).unwrap_or_default()
33727 }
33728}
33729impl Default for VISION_SPEED_ESTIMATE_DATA {
33730 fn default() -> Self {
33731 Self::DEFAULT.clone()
33732 }
33733}
33734impl MessageData for VISION_SPEED_ESTIMATE_DATA {
33735 type Message = MavMessage;
33736 const ID: u32 = 103u32;
33737 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
33738 const EXTRA_CRC: u8 = 208u8;
33739 const ENCODED_LEN: usize = 57usize;
33740 fn deser(
33741 _version: MavlinkVersion,
33742 __input: &[u8],
33743 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33744 let avail_len = __input.len();
33745 let mut payload_buf = [0; Self::ENCODED_LEN];
33746 let mut buf = if avail_len < Self::ENCODED_LEN {
33747 payload_buf[0..avail_len].copy_from_slice(__input);
33748 Bytes::new(&payload_buf)
33749 } else {
33750 Bytes::new(__input)
33751 };
33752 let mut __struct = Self::default();
33753 __struct.usec = buf.get_u64_le();
33754 __struct.x = buf.get_f32_le();
33755 __struct.y = buf.get_f32_le();
33756 __struct.z = buf.get_f32_le();
33757 for v in &mut __struct.covariance {
33758 let val = buf.get_f32_le();
33759 *v = val;
33760 }
33761 __struct.reset_counter = buf.get_u8();
33762 Ok(__struct)
33763 }
33764 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33765 let mut __tmp = BytesMut::new(bytes);
33766 #[allow(clippy::absurd_extreme_comparisons)]
33767 #[allow(unused_comparisons)]
33768 if __tmp.remaining() < Self::ENCODED_LEN {
33769 panic!(
33770 "buffer is too small (need {} bytes, but got {})",
33771 Self::ENCODED_LEN,
33772 __tmp.remaining(),
33773 )
33774 }
33775 __tmp.put_u64_le(self.usec);
33776 __tmp.put_f32_le(self.x);
33777 __tmp.put_f32_le(self.y);
33778 __tmp.put_f32_le(self.z);
33779 if matches!(version, MavlinkVersion::V2) {
33780 for val in &self.covariance {
33781 __tmp.put_f32_le(*val);
33782 }
33783 __tmp.put_u8(self.reset_counter);
33784 let len = __tmp.len();
33785 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33786 } else {
33787 __tmp.len()
33788 }
33789 }
33790}
33791#[doc = "Cumulative distance traveled for each reported wheel."]
33792#[doc = ""]
33793#[doc = "ID: 9000"]
33794#[derive(Debug, Clone, PartialEq)]
33795#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33796#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33797#[cfg_attr(feature = "ts", derive(TS))]
33798#[cfg_attr(feature = "ts", ts(export))]
33799pub struct WHEEL_DISTANCE_DATA {
33800 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
33801 pub time_usec: u64,
33802 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
33803 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33804 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33805 pub distance: [f64; 16],
33806 #[doc = "Number of wheels reported."]
33807 pub count: u8,
33808}
33809impl WHEEL_DISTANCE_DATA {
33810 pub const ENCODED_LEN: usize = 137usize;
33811 pub const DEFAULT: Self = Self {
33812 time_usec: 0_u64,
33813 distance: [0.0_f64; 16usize],
33814 count: 0_u8,
33815 };
33816 #[cfg(feature = "arbitrary")]
33817 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33818 use arbitrary::{Arbitrary, Unstructured};
33819 let mut buf = [0u8; 1024];
33820 rng.fill_bytes(&mut buf);
33821 let mut unstructured = Unstructured::new(&buf);
33822 Self::arbitrary(&mut unstructured).unwrap_or_default()
33823 }
33824}
33825impl Default for WHEEL_DISTANCE_DATA {
33826 fn default() -> Self {
33827 Self::DEFAULT.clone()
33828 }
33829}
33830impl MessageData for WHEEL_DISTANCE_DATA {
33831 type Message = MavMessage;
33832 const ID: u32 = 9000u32;
33833 const NAME: &'static str = "WHEEL_DISTANCE";
33834 const EXTRA_CRC: u8 = 113u8;
33835 const ENCODED_LEN: usize = 137usize;
33836 fn deser(
33837 _version: MavlinkVersion,
33838 __input: &[u8],
33839 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33840 let avail_len = __input.len();
33841 let mut payload_buf = [0; Self::ENCODED_LEN];
33842 let mut buf = if avail_len < Self::ENCODED_LEN {
33843 payload_buf[0..avail_len].copy_from_slice(__input);
33844 Bytes::new(&payload_buf)
33845 } else {
33846 Bytes::new(__input)
33847 };
33848 let mut __struct = Self::default();
33849 __struct.time_usec = buf.get_u64_le();
33850 for v in &mut __struct.distance {
33851 let val = buf.get_f64_le();
33852 *v = val;
33853 }
33854 __struct.count = buf.get_u8();
33855 Ok(__struct)
33856 }
33857 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33858 let mut __tmp = BytesMut::new(bytes);
33859 #[allow(clippy::absurd_extreme_comparisons)]
33860 #[allow(unused_comparisons)]
33861 if __tmp.remaining() < Self::ENCODED_LEN {
33862 panic!(
33863 "buffer is too small (need {} bytes, but got {})",
33864 Self::ENCODED_LEN,
33865 __tmp.remaining(),
33866 )
33867 }
33868 __tmp.put_u64_le(self.time_usec);
33869 for val in &self.distance {
33870 __tmp.put_f64_le(*val);
33871 }
33872 __tmp.put_u8(self.count);
33873 if matches!(version, MavlinkVersion::V2) {
33874 let len = __tmp.len();
33875 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33876 } else {
33877 __tmp.len()
33878 }
33879 }
33880}
33881#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33882#[doc = ""]
33883#[doc = "ID: 299"]
33884#[derive(Debug, Clone, PartialEq)]
33885#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33886#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33887#[cfg_attr(feature = "ts", derive(TS))]
33888#[cfg_attr(feature = "ts", ts(export))]
33889pub struct WIFI_CONFIG_AP_DATA {
33890 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
33891 #[cfg_attr(feature = "ts", ts(type = "string"))]
33892 pub ssid: CharArray<32>,
33893 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
33894 #[cfg_attr(feature = "ts", ts(type = "string"))]
33895 pub password: CharArray<64>,
33896 #[doc = "WiFi Mode."]
33897 #[cfg_attr(feature = "serde", serde(default))]
33898 pub mode: WifiConfigApMode,
33899 #[doc = "Message acceptance response (sent back to GS)."]
33900 #[cfg_attr(feature = "serde", serde(default))]
33901 pub response: WifiConfigApResponse,
33902}
33903impl WIFI_CONFIG_AP_DATA {
33904 pub const ENCODED_LEN: usize = 98usize;
33905 pub const DEFAULT: Self = Self {
33906 ssid: CharArray::new([0_u8; 32usize]),
33907 password: CharArray::new([0_u8; 64usize]),
33908 mode: WifiConfigApMode::DEFAULT,
33909 response: WifiConfigApResponse::DEFAULT,
33910 };
33911 #[cfg(feature = "arbitrary")]
33912 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33913 use arbitrary::{Arbitrary, Unstructured};
33914 let mut buf = [0u8; 1024];
33915 rng.fill_bytes(&mut buf);
33916 let mut unstructured = Unstructured::new(&buf);
33917 Self::arbitrary(&mut unstructured).unwrap_or_default()
33918 }
33919}
33920impl Default for WIFI_CONFIG_AP_DATA {
33921 fn default() -> Self {
33922 Self::DEFAULT.clone()
33923 }
33924}
33925impl MessageData for WIFI_CONFIG_AP_DATA {
33926 type Message = MavMessage;
33927 const ID: u32 = 299u32;
33928 const NAME: &'static str = "WIFI_CONFIG_AP";
33929 const EXTRA_CRC: u8 = 19u8;
33930 const ENCODED_LEN: usize = 98usize;
33931 fn deser(
33932 _version: MavlinkVersion,
33933 __input: &[u8],
33934 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33935 let avail_len = __input.len();
33936 let mut payload_buf = [0; Self::ENCODED_LEN];
33937 let mut buf = if avail_len < Self::ENCODED_LEN {
33938 payload_buf[0..avail_len].copy_from_slice(__input);
33939 Bytes::new(&payload_buf)
33940 } else {
33941 Bytes::new(__input)
33942 };
33943 let mut __struct = Self::default();
33944 let mut tmp = [0_u8; 32usize];
33945 for v in &mut tmp {
33946 *v = buf.get_u8();
33947 }
33948 __struct.ssid = CharArray::new(tmp);
33949 let mut tmp = [0_u8; 64usize];
33950 for v in &mut tmp {
33951 *v = buf.get_u8();
33952 }
33953 __struct.password = CharArray::new(tmp);
33954 let tmp = buf.get_i8();
33955 __struct.mode =
33956 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
33957 enum_type: "WifiConfigApMode",
33958 value: tmp as u32,
33959 })?;
33960 let tmp = buf.get_i8();
33961 __struct.response =
33962 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
33963 enum_type: "WifiConfigApResponse",
33964 value: tmp as u32,
33965 })?;
33966 Ok(__struct)
33967 }
33968 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33969 let mut __tmp = BytesMut::new(bytes);
33970 #[allow(clippy::absurd_extreme_comparisons)]
33971 #[allow(unused_comparisons)]
33972 if __tmp.remaining() < Self::ENCODED_LEN {
33973 panic!(
33974 "buffer is too small (need {} bytes, but got {})",
33975 Self::ENCODED_LEN,
33976 __tmp.remaining(),
33977 )
33978 }
33979 for val in &self.ssid {
33980 __tmp.put_u8(*val);
33981 }
33982 for val in &self.password {
33983 __tmp.put_u8(*val);
33984 }
33985 if matches!(version, MavlinkVersion::V2) {
33986 __tmp.put_i8(self.mode as i8);
33987 __tmp.put_i8(self.response as i8);
33988 let len = __tmp.len();
33989 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33990 } else {
33991 __tmp.len()
33992 }
33993 }
33994}
33995#[doc = "Winch status."]
33996#[doc = ""]
33997#[doc = "ID: 9005"]
33998#[derive(Debug, Clone, PartialEq)]
33999#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34000#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34001#[cfg_attr(feature = "ts", derive(TS))]
34002#[cfg_attr(feature = "ts", ts(export))]
34003pub struct WINCH_STATUS_DATA {
34004 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
34005 pub time_usec: u64,
34006 #[doc = "Length of line released. NaN if unknown"]
34007 pub line_length: f32,
34008 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
34009 pub speed: f32,
34010 #[doc = "Tension on the line. NaN if unknown"]
34011 pub tension: f32,
34012 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
34013 pub voltage: f32,
34014 #[doc = "Current draw from the winch. NaN if unknown"]
34015 pub current: f32,
34016 #[doc = "Status flags"]
34017 pub status: MavWinchStatusFlag,
34018 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
34019 pub temperature: i16,
34020}
34021impl WINCH_STATUS_DATA {
34022 pub const ENCODED_LEN: usize = 34usize;
34023 pub const DEFAULT: Self = Self {
34024 time_usec: 0_u64,
34025 line_length: 0.0_f32,
34026 speed: 0.0_f32,
34027 tension: 0.0_f32,
34028 voltage: 0.0_f32,
34029 current: 0.0_f32,
34030 status: MavWinchStatusFlag::DEFAULT,
34031 temperature: 0_i16,
34032 };
34033 #[cfg(feature = "arbitrary")]
34034 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34035 use arbitrary::{Arbitrary, Unstructured};
34036 let mut buf = [0u8; 1024];
34037 rng.fill_bytes(&mut buf);
34038 let mut unstructured = Unstructured::new(&buf);
34039 Self::arbitrary(&mut unstructured).unwrap_or_default()
34040 }
34041}
34042impl Default for WINCH_STATUS_DATA {
34043 fn default() -> Self {
34044 Self::DEFAULT.clone()
34045 }
34046}
34047impl MessageData for WINCH_STATUS_DATA {
34048 type Message = MavMessage;
34049 const ID: u32 = 9005u32;
34050 const NAME: &'static str = "WINCH_STATUS";
34051 const EXTRA_CRC: u8 = 117u8;
34052 const ENCODED_LEN: usize = 34usize;
34053 fn deser(
34054 _version: MavlinkVersion,
34055 __input: &[u8],
34056 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34057 let avail_len = __input.len();
34058 let mut payload_buf = [0; Self::ENCODED_LEN];
34059 let mut buf = if avail_len < Self::ENCODED_LEN {
34060 payload_buf[0..avail_len].copy_from_slice(__input);
34061 Bytes::new(&payload_buf)
34062 } else {
34063 Bytes::new(__input)
34064 };
34065 let mut __struct = Self::default();
34066 __struct.time_usec = buf.get_u64_le();
34067 __struct.line_length = buf.get_f32_le();
34068 __struct.speed = buf.get_f32_le();
34069 __struct.tension = buf.get_f32_le();
34070 __struct.voltage = buf.get_f32_le();
34071 __struct.current = buf.get_f32_le();
34072 let tmp = buf.get_u32_le();
34073 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
34074 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
34075 flag_type: "MavWinchStatusFlag",
34076 value: tmp as u32,
34077 })?;
34078 __struct.temperature = buf.get_i16_le();
34079 Ok(__struct)
34080 }
34081 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34082 let mut __tmp = BytesMut::new(bytes);
34083 #[allow(clippy::absurd_extreme_comparisons)]
34084 #[allow(unused_comparisons)]
34085 if __tmp.remaining() < Self::ENCODED_LEN {
34086 panic!(
34087 "buffer is too small (need {} bytes, but got {})",
34088 Self::ENCODED_LEN,
34089 __tmp.remaining(),
34090 )
34091 }
34092 __tmp.put_u64_le(self.time_usec);
34093 __tmp.put_f32_le(self.line_length);
34094 __tmp.put_f32_le(self.speed);
34095 __tmp.put_f32_le(self.tension);
34096 __tmp.put_f32_le(self.voltage);
34097 __tmp.put_f32_le(self.current);
34098 __tmp.put_u32_le(self.status.bits());
34099 __tmp.put_i16_le(self.temperature);
34100 if matches!(version, MavlinkVersion::V2) {
34101 let len = __tmp.len();
34102 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34103 } else {
34104 __tmp.len()
34105 }
34106 }
34107}
34108#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
34109#[doc = ""]
34110#[doc = "ID: 231"]
34111#[derive(Debug, Clone, PartialEq)]
34112#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34113#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34114#[cfg_attr(feature = "ts", derive(TS))]
34115#[cfg_attr(feature = "ts", ts(export))]
34116pub struct WIND_COV_DATA {
34117 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
34118 pub time_usec: u64,
34119 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
34120 pub wind_x: f32,
34121 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
34122 pub wind_y: f32,
34123 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
34124 pub wind_z: f32,
34125 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
34126 pub var_horiz: f32,
34127 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
34128 pub var_vert: f32,
34129 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
34130 pub wind_alt: f32,
34131 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
34132 pub horiz_accuracy: f32,
34133 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
34134 pub vert_accuracy: f32,
34135}
34136impl WIND_COV_DATA {
34137 pub const ENCODED_LEN: usize = 40usize;
34138 pub const DEFAULT: Self = Self {
34139 time_usec: 0_u64,
34140 wind_x: 0.0_f32,
34141 wind_y: 0.0_f32,
34142 wind_z: 0.0_f32,
34143 var_horiz: 0.0_f32,
34144 var_vert: 0.0_f32,
34145 wind_alt: 0.0_f32,
34146 horiz_accuracy: 0.0_f32,
34147 vert_accuracy: 0.0_f32,
34148 };
34149 #[cfg(feature = "arbitrary")]
34150 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34151 use arbitrary::{Arbitrary, Unstructured};
34152 let mut buf = [0u8; 1024];
34153 rng.fill_bytes(&mut buf);
34154 let mut unstructured = Unstructured::new(&buf);
34155 Self::arbitrary(&mut unstructured).unwrap_or_default()
34156 }
34157}
34158impl Default for WIND_COV_DATA {
34159 fn default() -> Self {
34160 Self::DEFAULT.clone()
34161 }
34162}
34163impl MessageData for WIND_COV_DATA {
34164 type Message = MavMessage;
34165 const ID: u32 = 231u32;
34166 const NAME: &'static str = "WIND_COV";
34167 const EXTRA_CRC: u8 = 105u8;
34168 const ENCODED_LEN: usize = 40usize;
34169 fn deser(
34170 _version: MavlinkVersion,
34171 __input: &[u8],
34172 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34173 let avail_len = __input.len();
34174 let mut payload_buf = [0; Self::ENCODED_LEN];
34175 let mut buf = if avail_len < Self::ENCODED_LEN {
34176 payload_buf[0..avail_len].copy_from_slice(__input);
34177 Bytes::new(&payload_buf)
34178 } else {
34179 Bytes::new(__input)
34180 };
34181 let mut __struct = Self::default();
34182 __struct.time_usec = buf.get_u64_le();
34183 __struct.wind_x = buf.get_f32_le();
34184 __struct.wind_y = buf.get_f32_le();
34185 __struct.wind_z = buf.get_f32_le();
34186 __struct.var_horiz = buf.get_f32_le();
34187 __struct.var_vert = buf.get_f32_le();
34188 __struct.wind_alt = buf.get_f32_le();
34189 __struct.horiz_accuracy = buf.get_f32_le();
34190 __struct.vert_accuracy = buf.get_f32_le();
34191 Ok(__struct)
34192 }
34193 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34194 let mut __tmp = BytesMut::new(bytes);
34195 #[allow(clippy::absurd_extreme_comparisons)]
34196 #[allow(unused_comparisons)]
34197 if __tmp.remaining() < Self::ENCODED_LEN {
34198 panic!(
34199 "buffer is too small (need {} bytes, but got {})",
34200 Self::ENCODED_LEN,
34201 __tmp.remaining(),
34202 )
34203 }
34204 __tmp.put_u64_le(self.time_usec);
34205 __tmp.put_f32_le(self.wind_x);
34206 __tmp.put_f32_le(self.wind_y);
34207 __tmp.put_f32_le(self.wind_z);
34208 __tmp.put_f32_le(self.var_horiz);
34209 __tmp.put_f32_le(self.var_vert);
34210 __tmp.put_f32_le(self.wind_alt);
34211 __tmp.put_f32_le(self.horiz_accuracy);
34212 __tmp.put_f32_le(self.vert_accuracy);
34213 if matches!(version, MavlinkVersion::V2) {
34214 let len = __tmp.len();
34215 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34216 } else {
34217 __tmp.len()
34218 }
34219 }
34220}
34221#[derive(Clone, PartialEq, Debug)]
34222#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34223#[cfg_attr(feature = "serde", serde(tag = "type"))]
34224#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34225#[cfg_attr(feature = "ts", derive(TS))]
34226#[cfg_attr(feature = "ts", ts(export))]
34227#[repr(u32)]
34228pub enum MavMessage {
34229 #[doc = "Set the vehicle attitude and body angular rates."]
34230 #[doc = ""]
34231 #[doc = "ID: 140"]
34232 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
34233 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
34234 #[doc = ""]
34235 #[doc = "ID: 375"]
34236 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
34237 #[doc = "The location and information of an ADSB vehicle."]
34238 #[doc = ""]
34239 #[doc = "ID: 246"]
34240 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
34241 #[doc = "The location and information of an AIS vessel."]
34242 #[doc = ""]
34243 #[doc = "ID: 301"]
34244 AIS_VESSEL(AIS_VESSEL_DATA),
34245 #[doc = "The current system altitude."]
34246 #[doc = ""]
34247 #[doc = "ID: 141"]
34248 ALTITUDE(ALTITUDE_DATA),
34249 #[doc = "ASL-fixed-wing controller data."]
34250 #[doc = ""]
34251 #[doc = "ID: 8004"]
34252 ASLCTRL_DATA(ASLCTRL_DATA_DATA),
34253 #[doc = "ASL-fixed-wing controller debug data."]
34254 #[doc = ""]
34255 #[doc = "ID: 8005"]
34256 ASLCTRL_DEBUG(ASLCTRL_DEBUG_DATA),
34257 #[doc = "Extended state information for ASLUAVs."]
34258 #[doc = ""]
34259 #[doc = "ID: 8006"]
34260 ASLUAV_STATUS(ASLUAV_STATUS_DATA),
34261 #[doc = "Off-board controls/commands for ASLUAVs."]
34262 #[doc = ""]
34263 #[doc = "ID: 8008"]
34264 ASL_OBCTRL(ASL_OBCTRL_DATA),
34265 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
34266 #[doc = ""]
34267 #[doc = "ID: 30"]
34268 ATTITUDE(ATTITUDE_DATA),
34269 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
34270 #[doc = ""]
34271 #[doc = "ID: 31"]
34272 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
34273 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
34274 #[doc = ""]
34275 #[doc = "ID: 61"]
34276 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
34277 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
34278 #[doc = ""]
34279 #[doc = "ID: 83"]
34280 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
34281 #[doc = "Motion capture attitude and position."]
34282 #[doc = ""]
34283 #[doc = "ID: 138"]
34284 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
34285 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
34286 #[doc = ""]
34287 #[doc = "ID: 7"]
34288 AUTH_KEY(AUTH_KEY_DATA),
34289 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
34290 #[doc = ""]
34291 #[doc = "ID: 286"]
34292 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
34293 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
34294 #[doc = ""]
34295 #[doc = "ID: 148"]
34296 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
34297 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
34298 #[doc = ""]
34299 #[doc = "ID: 435"]
34300 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
34301 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
34302 #[doc = ""]
34303 #[doc = "ID: 437"]
34304 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
34305 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
34306 #[doc = ""]
34307 #[doc = "ID: 372"]
34308 BATTERY_INFO(BATTERY_INFO_DATA),
34309 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
34310 #[doc = ""]
34311 #[doc = "ID: 147"]
34312 BATTERY_STATUS(BATTERY_STATUS_DATA),
34313 #[doc = "Report button state change."]
34314 #[doc = ""]
34315 #[doc = "ID: 257"]
34316 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
34317 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
34318 #[doc = ""]
34319 #[doc = "ID: 262"]
34320 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
34321 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
34322 #[doc = ""]
34323 #[doc = "ID: 271"]
34324 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
34325 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
34326 #[doc = ""]
34327 #[doc = "ID: 263"]
34328 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
34329 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
34330 #[doc = ""]
34331 #[doc = "ID: 259"]
34332 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
34333 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
34334 #[doc = ""]
34335 #[doc = "ID: 260"]
34336 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
34337 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
34338 #[doc = ""]
34339 #[doc = "ID: 277"]
34340 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
34341 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
34342 #[doc = ""]
34343 #[doc = "ID: 276"]
34344 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
34345 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
34346 #[doc = ""]
34347 #[doc = "ID: 275"]
34348 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
34349 #[doc = "Camera-IMU triggering and synchronisation message."]
34350 #[doc = ""]
34351 #[doc = "ID: 112"]
34352 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
34353 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
34354 #[doc = ""]
34355 #[doc = "ID: 387"]
34356 CANFD_FRAME(CANFD_FRAME_DATA),
34357 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
34358 #[doc = ""]
34359 #[doc = "ID: 388"]
34360 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
34361 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
34362 #[doc = ""]
34363 #[doc = "ID: 386"]
34364 CAN_FRAME(CAN_FRAME_DATA),
34365 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
34366 #[doc = ""]
34367 #[doc = "ID: 336"]
34368 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
34369 #[doc = "Report current used cellular network status."]
34370 #[doc = ""]
34371 #[doc = "ID: 334"]
34372 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
34373 #[doc = "Request to control this MAV."]
34374 #[doc = ""]
34375 #[doc = "ID: 5"]
34376 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
34377 #[doc = "Accept / deny control of this MAV."]
34378 #[doc = ""]
34379 #[doc = "ID: 6"]
34380 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
34381 #[doc = "Information about a potential collision."]
34382 #[doc = ""]
34383 #[doc = "ID: 247"]
34384 COLLISION(COLLISION_DATA),
34385 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
34386 #[doc = ""]
34387 #[doc = "ID: 77"]
34388 COMMAND_ACK(COMMAND_ACK_DATA),
34389 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
34390 #[doc = ""]
34391 #[doc = "ID: 80"]
34392 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
34393 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
34394 #[doc = ""]
34395 #[doc = "ID: 75"]
34396 COMMAND_INT(COMMAND_INT_DATA),
34397 #[doc = "Message encoding a command with parameters as scaled integers and additional metadata. Scaling depends on the actual command value."]
34398 #[doc = ""]
34399 #[doc = "ID: 223"]
34400 COMMAND_INT_STAMPED(COMMAND_INT_STAMPED_DATA),
34401 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
34402 #[doc = ""]
34403 #[doc = "ID: 76"]
34404 COMMAND_LONG(COMMAND_LONG_DATA),
34405 #[doc = "Send a command with up to seven parameters to the MAV and additional metadata."]
34406 #[doc = ""]
34407 #[doc = "ID: 224"]
34408 COMMAND_LONG_STAMPED(COMMAND_LONG_STAMPED_DATA),
34409 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
34410 #[doc = ""]
34411 #[doc = "ID: 395"]
34412 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
34413 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
34414 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
34415 #[doc = ""]
34416 #[doc = "ID: 396"]
34417 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
34418 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
34419 #[doc = ""]
34420 #[doc = "ID: 397"]
34421 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
34422 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
34423 #[doc = ""]
34424 #[doc = "ID: 146"]
34425 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
34426 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
34427 #[doc = ""]
34428 #[doc = "ID: 411"]
34429 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
34430 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
34431 #[doc = ""]
34432 #[doc = "ID: 436"]
34433 CURRENT_MODE(CURRENT_MODE_DATA),
34434 #[doc = "Data stream status information."]
34435 #[doc = ""]
34436 #[doc = "ID: 67"]
34437 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
34438 DATA_STREAM(DATA_STREAM_DATA),
34439 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
34440 #[doc = ""]
34441 #[doc = "ID: 130"]
34442 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
34443 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
34444 #[doc = ""]
34445 #[doc = "ID: 254"]
34446 DEBUG(DEBUG_DATA),
34447 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
34448 #[doc = ""]
34449 #[doc = "ID: 350"]
34450 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
34451 #[doc = "To debug something using a named 3D vector."]
34452 #[doc = ""]
34453 #[doc = "ID: 250"]
34454 DEBUG_VECT(DEBUG_VECT_DATA),
34455 #[doc = "Distance sensor information for an onboard rangefinder."]
34456 #[doc = ""]
34457 #[doc = "ID: 132"]
34458 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
34459 #[doc = "EFI status output."]
34460 #[doc = ""]
34461 #[doc = "ID: 225"]
34462 EFI_STATUS(EFI_STATUS_DATA),
34463 #[doc = "Extended EKF state estimates for ASLUAVs."]
34464 #[doc = ""]
34465 #[doc = "ID: 8007"]
34466 EKF_EXT(EKF_EXT_DATA),
34467 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
34468 #[doc = ""]
34469 #[doc = "ID: 131"]
34470 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
34471 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
34472 #[doc = ""]
34473 #[doc = "ID: 290"]
34474 ESC_INFO(ESC_INFO_DATA),
34475 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
34476 #[doc = ""]
34477 #[doc = "ID: 291"]
34478 ESC_STATUS(ESC_STATUS_DATA),
34479 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
34480 #[doc = ""]
34481 #[doc = "ID: 230"]
34482 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
34483 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
34484 #[doc = ""]
34485 #[doc = "ID: 410"]
34486 EVENT(EVENT_DATA),
34487 #[doc = "Provides state for additional features."]
34488 #[doc = ""]
34489 #[doc = "ID: 245"]
34490 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
34491 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
34492 #[doc = ""]
34493 #[doc = "ID: 162"]
34494 FENCE_STATUS(FENCE_STATUS_DATA),
34495 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
34496 #[doc = ""]
34497 #[doc = "ID: 110"]
34498 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
34499 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
34500 #[doc = ""]
34501 #[doc = "ID: 264"]
34502 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
34503 #[doc = "Current motion information from a designated system."]
34504 #[doc = ""]
34505 #[doc = "ID: 144"]
34506 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
34507 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
34508 #[doc = ""]
34509 #[doc = "ID: 371"]
34510 FUEL_STATUS(FUEL_STATUS_DATA),
34511 #[doc = "Fixed-wing soaring (i.e. thermal seeking) data."]
34512 #[doc = ""]
34513 #[doc = "ID: 8011"]
34514 FW_SOARING_DATA(FW_SOARING_DATA_DATA),
34515 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
34516 #[doc = ""]
34517 #[doc = "ID: 373"]
34518 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
34519 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
34520 #[doc = ""]
34521 #[doc = "ID: 285"]
34522 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
34523 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
34524 #[doc = ""]
34525 #[doc = "ID: 283"]
34526 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
34527 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
34528 #[doc = ""]
34529 #[doc = "ID: 284"]
34530 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
34531 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
34532 #[doc = ""]
34533 #[doc = "ID: 280"]
34534 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
34535 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
34536 #[doc = ""]
34537 #[doc = "ID: 282"]
34538 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
34539 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
34540 #[doc = ""]
34541 #[doc = "ID: 288"]
34542 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
34543 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
34544 #[doc = ""]
34545 #[doc = "ID: 287"]
34546 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
34547 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
34548 #[doc = ""]
34549 #[doc = "ID: 281"]
34550 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
34551 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
34552 #[doc = ""]
34553 #[doc = "ID: 33"]
34554 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
34555 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
34556 #[doc = ""]
34557 #[doc = "ID: 63"]
34558 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
34559 #[doc = "Global position/attitude estimate from a vision source."]
34560 #[doc = ""]
34561 #[doc = "ID: 101"]
34562 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
34563 #[doc = "Second GPS data."]
34564 #[doc = ""]
34565 #[doc = "ID: 124"]
34566 GPS2_RAW(GPS2_RAW_DATA),
34567 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
34568 #[doc = ""]
34569 #[doc = "ID: 128"]
34570 GPS2_RTK(GPS2_RTK_DATA),
34571 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
34572 #[doc = ""]
34573 #[doc = "ID: 49"]
34574 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
34575 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
34576 #[doc = ""]
34577 #[doc = "ID: 123"]
34578 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
34579 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
34580 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
34581 #[doc = ""]
34582 #[doc = "ID: 232"]
34583 GPS_INPUT(GPS_INPUT_DATA),
34584 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
34585 #[doc = ""]
34586 #[doc = "ID: 24"]
34587 GPS_RAW_INT(GPS_RAW_INT_DATA),
34588 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
34589 #[doc = ""]
34590 #[doc = "ID: 233"]
34591 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
34592 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
34593 #[doc = ""]
34594 #[doc = "ID: 127"]
34595 GPS_RTK(GPS_RTK_DATA),
34596 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
34597 #[doc = ""]
34598 #[doc = "ID: 25"]
34599 GPS_STATUS(GPS_STATUS_DATA),
34600 #[doc = "Status of GSM modem (connected to onboard computer)."]
34601 #[doc = ""]
34602 #[doc = "ID: 8014"]
34603 GSM_LINK_STATUS(GSM_LINK_STATUS_DATA),
34604 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
34605 #[doc = ""]
34606 #[doc = "ID: 0"]
34607 HEARTBEAT(HEARTBEAT_DATA),
34608 #[doc = "The IMU readings in SI units in NED body frame."]
34609 #[doc = ""]
34610 #[doc = "ID: 105"]
34611 HIGHRES_IMU(HIGHRES_IMU_DATA),
34612 #[doc = "Message appropriate for high latency connections like Iridium."]
34613 #[doc = ""]
34614 #[doc = "ID: 234"]
34615 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
34616 HIGH_LATENCY(HIGH_LATENCY_DATA),
34617 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
34618 #[doc = ""]
34619 #[doc = "ID: 235"]
34620 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
34621 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
34622 #[doc = ""]
34623 #[doc = "ID: 93"]
34624 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
34625 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
34626 #[doc = ""]
34627 #[doc = "ID: 91"]
34628 HIL_CONTROLS(HIL_CONTROLS_DATA),
34629 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
34630 #[doc = ""]
34631 #[doc = "ID: 113"]
34632 HIL_GPS(HIL_GPS_DATA),
34633 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
34634 #[doc = ""]
34635 #[doc = "ID: 114"]
34636 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
34637 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
34638 #[doc = ""]
34639 #[doc = "ID: 92"]
34640 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
34641 #[doc = "The IMU readings in SI units in NED body frame."]
34642 #[doc = ""]
34643 #[doc = "ID: 107"]
34644 HIL_SENSOR(HIL_SENSOR_DATA),
34645 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
34646 #[doc = ""]
34647 #[doc = "ID: 90"]
34648 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
34649 HIL_STATE(HIL_STATE_DATA),
34650 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
34651 #[doc = ""]
34652 #[doc = "ID: 115"]
34653 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
34654 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
34655 #[doc = ""]
34656 #[doc = "ID: 242"]
34657 HOME_POSITION(HOME_POSITION_DATA),
34658 #[doc = "Temperature and humidity from hygrometer."]
34659 #[doc = ""]
34660 #[doc = "ID: 12920"]
34661 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
34662 #[doc = "Illuminator status."]
34663 #[doc = ""]
34664 #[doc = "ID: 440"]
34665 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
34666 #[doc = "Status of the Iridium SBD link."]
34667 #[doc = ""]
34668 #[doc = "ID: 335"]
34669 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
34670 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
34671 #[doc = ""]
34672 #[doc = "ID: 149"]
34673 LANDING_TARGET(LANDING_TARGET_DATA),
34674 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
34675 #[doc = ""]
34676 #[doc = "ID: 8"]
34677 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
34678 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
34679 #[doc = ""]
34680 #[doc = "ID: 32"]
34681 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
34682 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
34683 #[doc = ""]
34684 #[doc = "ID: 64"]
34685 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
34686 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
34687 #[doc = ""]
34688 #[doc = "ID: 89"]
34689 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
34690 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
34691 #[doc = ""]
34692 #[doc = "ID: 268"]
34693 LOGGING_ACK(LOGGING_ACK_DATA),
34694 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
34695 #[doc = ""]
34696 #[doc = "ID: 266"]
34697 LOGGING_DATA(LOGGING_DATA_DATA),
34698 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
34699 #[doc = ""]
34700 #[doc = "ID: 267"]
34701 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
34702 #[doc = "Reply to LOG_REQUEST_DATA."]
34703 #[doc = ""]
34704 #[doc = "ID: 120"]
34705 LOG_DATA(LOG_DATA_DATA),
34706 #[doc = "Reply to LOG_REQUEST_LIST."]
34707 #[doc = ""]
34708 #[doc = "ID: 118"]
34709 LOG_ENTRY(LOG_ENTRY_DATA),
34710 #[doc = "Erase all logs."]
34711 #[doc = ""]
34712 #[doc = "ID: 121"]
34713 LOG_ERASE(LOG_ERASE_DATA),
34714 #[doc = "Request a chunk of a log."]
34715 #[doc = ""]
34716 #[doc = "ID: 119"]
34717 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
34718 #[doc = "Stop log transfer and resume normal logging."]
34719 #[doc = ""]
34720 #[doc = "ID: 122"]
34721 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
34722 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
34723 #[doc = ""]
34724 #[doc = "ID: 117"]
34725 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
34726 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
34727 #[doc = ""]
34728 #[doc = "ID: 192"]
34729 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
34730 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
34731 #[doc = ""]
34732 #[doc = "ID: 69"]
34733 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
34734 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
34735 #[doc = ""]
34736 #[doc = "ID: 81"]
34737 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
34738 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
34739 #[doc = ""]
34740 #[doc = "ID: 249"]
34741 MEMORY_VECT(MEMORY_VECT_DATA),
34742 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
34743 #[doc = ""]
34744 #[doc = "ID: 244"]
34745 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
34746 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
34747 #[doc = ""]
34748 #[doc = "ID: 47"]
34749 MISSION_ACK(MISSION_ACK_DATA),
34750 #[doc = "Delete all mission items at once."]
34751 #[doc = ""]
34752 #[doc = "ID: 45"]
34753 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
34754 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
34755 #[doc = ""]
34756 #[doc = "ID: 44"]
34757 MISSION_COUNT(MISSION_COUNT_DATA),
34758 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
34759 #[doc = ""]
34760 #[doc = "ID: 42"]
34761 MISSION_CURRENT(MISSION_CURRENT_DATA),
34762 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
34763 #[doc = ""]
34764 #[doc = "ID: 39"]
34765 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
34766 MISSION_ITEM(MISSION_ITEM_DATA),
34767 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
34768 #[doc = ""]
34769 #[doc = "ID: 73"]
34770 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
34771 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
34772 #[doc = ""]
34773 #[doc = "ID: 46"]
34774 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
34775 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
34776 #[doc = ""]
34777 #[doc = "ID: 40"]
34778 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
34779 MISSION_REQUEST(MISSION_REQUEST_DATA),
34780 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
34781 #[doc = ""]
34782 #[doc = "ID: 51"]
34783 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
34784 #[doc = "Request the overall list of mission items from the system/component."]
34785 #[doc = ""]
34786 #[doc = "ID: 43"]
34787 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
34788 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
34789 #[doc = ""]
34790 #[doc = "ID: 37"]
34791 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
34792 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
34793 #[doc = ""]
34794 #[doc = "ID: 41"]
34795 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
34796 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
34797 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
34798 #[doc = ""]
34799 #[doc = "ID: 38"]
34800 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
34801 #[doc = "Orientation of a mount."]
34802 #[doc = ""]
34803 #[doc = "ID: 265"]
34804 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
34805 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
34806 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
34807 #[doc = ""]
34808 #[doc = "ID: 251"]
34809 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
34810 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
34811 #[doc = ""]
34812 #[doc = "ID: 252"]
34813 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
34814 #[doc = "The state of the navigation and position controller."]
34815 #[doc = ""]
34816 #[doc = "ID: 62"]
34817 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
34818 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
34819 #[doc = ""]
34820 #[doc = "ID: 330"]
34821 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
34822 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
34823 #[doc = ""]
34824 #[doc = "ID: 331"]
34825 ODOMETRY(ODOMETRY_DATA),
34826 #[doc = "Hardware status sent by an onboard computer."]
34827 #[doc = ""]
34828 #[doc = "ID: 390"]
34829 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
34830 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
34831 #[doc = ""]
34832 #[doc = "ID: 12918"]
34833 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
34834 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
34835 #[doc = ""]
34836 #[doc = "ID: 12902"]
34837 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
34838 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
34839 #[doc = ""]
34840 #[doc = "ID: 12900"]
34841 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
34842 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
34843 #[doc = ""]
34844 #[doc = "ID: 12901"]
34845 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
34846 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
34847 #[doc = ""]
34848 #[doc = "ID: 12915"]
34849 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
34850 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
34851 #[doc = ""]
34852 #[doc = "ID: 12905"]
34853 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
34854 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
34855 #[doc = ""]
34856 #[doc = "ID: 12903"]
34857 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
34858 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
34859 #[doc = ""]
34860 #[doc = "ID: 12904"]
34861 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
34862 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
34863 #[doc = ""]
34864 #[doc = "ID: 12919"]
34865 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
34866 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
34867 #[doc = ""]
34868 #[doc = "ID: 100"]
34869 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
34870 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
34871 #[doc = ""]
34872 #[doc = "ID: 106"]
34873 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
34874 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
34875 #[doc = ""]
34876 #[doc = "ID: 360"]
34877 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
34878 #[doc = "Response from a PARAM_EXT_SET message."]
34879 #[doc = ""]
34880 #[doc = "ID: 324"]
34881 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
34882 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
34883 #[doc = ""]
34884 #[doc = "ID: 321"]
34885 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
34886 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
34887 #[doc = ""]
34888 #[doc = "ID: 320"]
34889 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
34890 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
34891 #[doc = ""]
34892 #[doc = "ID: 323"]
34893 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
34894 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
34895 #[doc = ""]
34896 #[doc = "ID: 322"]
34897 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
34898 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
34899 #[doc = ""]
34900 #[doc = "ID: 50"]
34901 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
34902 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
34903 #[doc = ""]
34904 #[doc = "ID: 21"]
34905 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
34906 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
34907 #[doc = ""]
34908 #[doc = "ID: 20"]
34909 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
34910 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
34911 #[doc = ""]
34912 #[doc = "ID: 23"]
34913 PARAM_SET(PARAM_SET_DATA),
34914 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
34915 #[doc = ""]
34916 #[doc = "ID: 22"]
34917 PARAM_VALUE(PARAM_VALUE_DATA),
34918 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
34919 #[doc = ""]
34920 #[doc = "ID: 4"]
34921 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
34922 PING(PING_DATA),
34923 #[doc = "Control vehicle tone generation (buzzer)."]
34924 #[doc = ""]
34925 #[doc = "ID: 258"]
34926 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
34927 PLAY_TUNE(PLAY_TUNE_DATA),
34928 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
34929 #[doc = ""]
34930 #[doc = "ID: 400"]
34931 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
34932 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
34933 #[doc = ""]
34934 #[doc = "ID: 87"]
34935 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
34936 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
34937 #[doc = ""]
34938 #[doc = "ID: 85"]
34939 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
34940 #[doc = "Power supply status."]
34941 #[doc = ""]
34942 #[doc = "ID: 125"]
34943 POWER_STATUS(POWER_STATUS_DATA),
34944 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
34945 #[doc = ""]
34946 #[doc = "ID: 300"]
34947 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
34948 #[doc = "Status generated by radio and injected into MAVLink stream."]
34949 #[doc = ""]
34950 #[doc = "ID: 109"]
34951 RADIO_STATUS(RADIO_STATUS_DATA),
34952 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
34953 #[doc = ""]
34954 #[doc = "ID: 27"]
34955 RAW_IMU(RAW_IMU_DATA),
34956 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
34957 #[doc = ""]
34958 #[doc = "ID: 28"]
34959 RAW_PRESSURE(RAW_PRESSURE_DATA),
34960 #[doc = "RPM sensor data message."]
34961 #[doc = ""]
34962 #[doc = "ID: 339"]
34963 RAW_RPM(RAW_RPM_DATA),
34964 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
34965 #[doc = ""]
34966 #[doc = "ID: 65"]
34967 RC_CHANNELS(RC_CHANNELS_DATA),
34968 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
34969 #[doc = ""]
34970 #[doc = "ID: 70"]
34971 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
34972 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
34973 #[doc = ""]
34974 #[doc = "ID: 35"]
34975 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
34976 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
34977 #[doc = ""]
34978 #[doc = "ID: 34"]
34979 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
34980 #[doc = "Request a data stream."]
34981 #[doc = ""]
34982 #[doc = "ID: 66"]
34983 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
34984 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
34985 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
34986 #[doc = ""]
34987 #[doc = "ID: 412"]
34988 REQUEST_EVENT(REQUEST_EVENT_DATA),
34989 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
34990 #[doc = ""]
34991 #[doc = "ID: 142"]
34992 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
34993 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
34994 #[doc = ""]
34995 #[doc = "ID: 413"]
34996 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
34997 #[doc = "Read out the safety zone the MAV currently assumes."]
34998 #[doc = ""]
34999 #[doc = "ID: 55"]
35000 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
35001 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
35002 #[doc = ""]
35003 #[doc = "ID: 54"]
35004 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
35005 #[doc = "Status of the SatCom link."]
35006 #[doc = ""]
35007 #[doc = "ID: 8015"]
35008 SATCOM_LINK_STATUS(SATCOM_LINK_STATUS_DATA),
35009 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
35010 #[doc = ""]
35011 #[doc = "ID: 26"]
35012 SCALED_IMU(SCALED_IMU_DATA),
35013 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
35014 #[doc = ""]
35015 #[doc = "ID: 116"]
35016 SCALED_IMU2(SCALED_IMU2_DATA),
35017 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
35018 #[doc = ""]
35019 #[doc = "ID: 129"]
35020 SCALED_IMU3(SCALED_IMU3_DATA),
35021 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
35022 #[doc = ""]
35023 #[doc = "ID: 29"]
35024 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
35025 #[doc = "Barometer readings for 2nd barometer."]
35026 #[doc = ""]
35027 #[doc = "ID: 137"]
35028 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
35029 #[doc = "Barometer readings for 3rd barometer."]
35030 #[doc = ""]
35031 #[doc = "ID: 143"]
35032 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
35033 #[doc = "Monitoring of sensorpod status."]
35034 #[doc = ""]
35035 #[doc = "ID: 8012"]
35036 SENSORPOD_STATUS(SENSORPOD_STATUS_DATA),
35037 #[doc = "Calibrated airflow angle measurements."]
35038 #[doc = ""]
35039 #[doc = "ID: 8016"]
35040 SENSOR_AIRFLOW_ANGLES(SENSOR_AIRFLOW_ANGLES_DATA),
35041 #[doc = "Atmospheric sensors (temperature, humidity, ...)."]
35042 #[doc = ""]
35043 #[doc = "ID: 8009"]
35044 SENS_ATMOS(SENS_ATMOS_DATA),
35045 #[doc = "Battery pack monitoring data for Li-Ion batteries."]
35046 #[doc = ""]
35047 #[doc = "ID: 8010"]
35048 SENS_BATMON(SENS_BATMON_DATA),
35049 #[doc = "Maximum Power Point Tracker (MPPT) sensor data for solar module power performance tracking."]
35050 #[doc = ""]
35051 #[doc = "ID: 8003"]
35052 SENS_MPPT(SENS_MPPT_DATA),
35053 #[doc = "Voltage and current sensor data."]
35054 #[doc = ""]
35055 #[doc = "ID: 8002"]
35056 SENS_POWER(SENS_POWER_DATA),
35057 #[doc = "Monitoring of power board status."]
35058 #[doc = ""]
35059 #[doc = "ID: 8013"]
35060 SENS_POWER_BOARD(SENS_POWER_BOARD_DATA),
35061 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
35062 #[doc = ""]
35063 #[doc = "ID: 126"]
35064 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
35065 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
35066 #[doc = ""]
35067 #[doc = "ID: 36"]
35068 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
35069 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
35070 #[doc = ""]
35071 #[doc = "ID: 256"]
35072 SETUP_SIGNING(SETUP_SIGNING_DATA),
35073 #[doc = "Set the vehicle attitude and body angular rates."]
35074 #[doc = ""]
35075 #[doc = "ID: 139"]
35076 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
35077 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
35078 #[doc = ""]
35079 #[doc = "ID: 82"]
35080 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
35081 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
35082 #[doc = ""]
35083 #[doc = "ID: 48"]
35084 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
35085 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
35086 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
35087 #[doc = ""]
35088 #[doc = "ID: 243"]
35089 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
35090 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
35091 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
35092 #[doc = ""]
35093 #[doc = "ID: 11"]
35094 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
35095 SET_MODE(SET_MODE_DATA),
35096 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
35097 #[doc = ""]
35098 #[doc = "ID: 86"]
35099 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
35100 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
35101 #[doc = ""]
35102 #[doc = "ID: 84"]
35103 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
35104 #[doc = "Status of simulation environment, if used."]
35105 #[doc = ""]
35106 #[doc = "ID: 108"]
35107 SIM_STATE(SIM_STATE_DATA),
35108 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
35109 #[doc = ""]
35110 #[doc = "ID: 370"]
35111 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
35112 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
35113 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
35114 #[doc = ""]
35115 #[doc = "ID: 253"]
35116 STATUSTEXT(STATUSTEXT_DATA),
35117 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
35118 #[doc = ""]
35119 #[doc = "ID: 261"]
35120 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
35121 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
35122 #[doc = ""]
35123 #[doc = "ID: 401"]
35124 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
35125 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
35126 #[doc = ""]
35127 #[doc = "ID: 2"]
35128 SYSTEM_TIME(SYSTEM_TIME_DATA),
35129 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
35130 #[doc = ""]
35131 #[doc = "ID: 1"]
35132 SYS_STATUS(SYS_STATUS_DATA),
35133 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
35134 #[doc = ""]
35135 #[doc = "ID: 135"]
35136 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
35137 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
35138 #[doc = ""]
35139 #[doc = "ID: 134"]
35140 TERRAIN_DATA(TERRAIN_DATA_DATA),
35141 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
35142 #[doc = ""]
35143 #[doc = "ID: 136"]
35144 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
35145 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
35146 #[doc = ""]
35147 #[doc = "ID: 133"]
35148 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
35149 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
35150 #[doc = ""]
35151 #[doc = "ID: 111"]
35152 TIMESYNC(TIMESYNC_DATA),
35153 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
35154 #[doc = ""]
35155 #[doc = "ID: 380"]
35156 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
35157 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
35158 #[doc = ""]
35159 #[doc = "ID: 333"]
35160 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
35161 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
35162 #[doc = ""]
35163 #[doc = "ID: 332"]
35164 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
35165 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
35166 #[doc = ""]
35167 #[doc = "ID: 385"]
35168 TUNNEL(TUNNEL_DATA),
35169 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
35170 #[doc = ""]
35171 #[doc = "ID: 311"]
35172 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
35173 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
35174 #[doc = ""]
35175 #[doc = "ID: 310"]
35176 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
35177 #[doc = "The global position resulting from GPS and sensor fusion."]
35178 #[doc = ""]
35179 #[doc = "ID: 340"]
35180 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
35181 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
35182 #[doc = ""]
35183 #[doc = "ID: 248"]
35184 V2_EXTENSION(V2_EXTENSION_DATA),
35185 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
35186 #[doc = ""]
35187 #[doc = "ID: 74"]
35188 VFR_HUD(VFR_HUD_DATA),
35189 #[doc = "Vibration levels and accelerometer clipping."]
35190 #[doc = ""]
35191 #[doc = "ID: 241"]
35192 VIBRATION(VIBRATION_DATA),
35193 #[doc = "Global position estimate from a Vicon motion system source."]
35194 #[doc = ""]
35195 #[doc = "ID: 104"]
35196 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
35197 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
35198 #[doc = ""]
35199 #[doc = "ID: 269"]
35200 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
35201 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
35202 #[doc = ""]
35203 #[doc = "ID: 270"]
35204 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
35205 #[doc = "Local position/attitude estimate from a vision source."]
35206 #[doc = ""]
35207 #[doc = "ID: 102"]
35208 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
35209 #[doc = "Speed estimate from a vision source."]
35210 #[doc = ""]
35211 #[doc = "ID: 103"]
35212 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
35213 #[doc = "Cumulative distance traveled for each reported wheel."]
35214 #[doc = ""]
35215 #[doc = "ID: 9000"]
35216 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
35217 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
35218 #[doc = ""]
35219 #[doc = "ID: 299"]
35220 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
35221 #[doc = "Winch status."]
35222 #[doc = ""]
35223 #[doc = "ID: 9005"]
35224 WINCH_STATUS(WINCH_STATUS_DATA),
35225 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
35226 #[doc = ""]
35227 #[doc = "ID: 231"]
35228 WIND_COV(WIND_COV_DATA),
35229}
35230impl MavMessage {
35231 pub const fn all_ids() -> &'static [u32] {
35232 &[
35233 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
35234 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
35235 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
35236 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
35237 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
35238 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
35239 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
35240 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
35241 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
35242 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
35243 148u32, 149u32, 162u32, 192u32, 223u32, 224u32, 225u32, 230u32, 231u32, 232u32, 233u32,
35244 234u32, 235u32, 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32,
35245 250u32, 251u32, 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32,
35246 262u32, 263u32, 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32,
35247 276u32, 277u32, 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32,
35248 290u32, 291u32, 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32,
35249 324u32, 330u32, 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32,
35250 360u32, 370u32, 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32,
35251 390u32, 395u32, 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32,
35252 436u32, 437u32, 440u32, 8002u32, 8003u32, 8004u32, 8005u32, 8006u32, 8007u32, 8008u32,
35253 8009u32, 8010u32, 8011u32, 8012u32, 8013u32, 8014u32, 8015u32, 8016u32, 9000u32,
35254 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32, 12915u32,
35255 12918u32, 12919u32, 12920u32,
35256 ]
35257 }
35258}
35259impl Message for MavMessage {
35260 fn parse(
35261 version: MavlinkVersion,
35262 id: u32,
35263 payload: &[u8],
35264 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35265 match id {
35266 ACTUATOR_CONTROL_TARGET_DATA::ID => {
35267 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
35268 .map(Self::ACTUATOR_CONTROL_TARGET)
35269 }
35270 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
35271 .map(Self::ACTUATOR_OUTPUT_STATUS),
35272 ADSB_VEHICLE_DATA::ID => {
35273 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
35274 }
35275 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
35276 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
35277 ASLCTRL_DATA_DATA::ID => {
35278 ASLCTRL_DATA_DATA::deser(version, payload).map(Self::ASLCTRL_DATA)
35279 }
35280 ASLCTRL_DEBUG_DATA::ID => {
35281 ASLCTRL_DEBUG_DATA::deser(version, payload).map(Self::ASLCTRL_DEBUG)
35282 }
35283 ASLUAV_STATUS_DATA::ID => {
35284 ASLUAV_STATUS_DATA::deser(version, payload).map(Self::ASLUAV_STATUS)
35285 }
35286 ASL_OBCTRL_DATA::ID => ASL_OBCTRL_DATA::deser(version, payload).map(Self::ASL_OBCTRL),
35287 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
35288 ATTITUDE_QUATERNION_DATA::ID => {
35289 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
35290 }
35291 ATTITUDE_QUATERNION_COV_DATA::ID => {
35292 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
35293 .map(Self::ATTITUDE_QUATERNION_COV)
35294 }
35295 ATTITUDE_TARGET_DATA::ID => {
35296 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
35297 }
35298 ATT_POS_MOCAP_DATA::ID => {
35299 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
35300 }
35301 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
35302 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35303 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
35304 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
35305 }
35306 AUTOPILOT_VERSION_DATA::ID => {
35307 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
35308 }
35309 AVAILABLE_MODES_DATA::ID => {
35310 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
35311 }
35312 AVAILABLE_MODES_MONITOR_DATA::ID => {
35313 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
35314 .map(Self::AVAILABLE_MODES_MONITOR)
35315 }
35316 BATTERY_INFO_DATA::ID => {
35317 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
35318 }
35319 BATTERY_STATUS_DATA::ID => {
35320 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
35321 }
35322 BUTTON_CHANGE_DATA::ID => {
35323 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
35324 }
35325 CAMERA_CAPTURE_STATUS_DATA::ID => {
35326 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
35327 }
35328 CAMERA_FOV_STATUS_DATA::ID => {
35329 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
35330 }
35331 CAMERA_IMAGE_CAPTURED_DATA::ID => {
35332 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
35333 }
35334 CAMERA_INFORMATION_DATA::ID => {
35335 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
35336 }
35337 CAMERA_SETTINGS_DATA::ID => {
35338 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
35339 }
35340 CAMERA_THERMAL_RANGE_DATA::ID => {
35341 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
35342 }
35343 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
35344 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
35345 .map(Self::CAMERA_TRACKING_GEO_STATUS)
35346 }
35347 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
35348 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
35349 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
35350 }
35351 CAMERA_TRIGGER_DATA::ID => {
35352 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
35353 }
35354 CANFD_FRAME_DATA::ID => {
35355 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
35356 }
35357 CAN_FILTER_MODIFY_DATA::ID => {
35358 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
35359 }
35360 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
35361 CELLULAR_CONFIG_DATA::ID => {
35362 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
35363 }
35364 CELLULAR_STATUS_DATA::ID => {
35365 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
35366 }
35367 CHANGE_OPERATOR_CONTROL_DATA::ID => {
35368 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
35369 .map(Self::CHANGE_OPERATOR_CONTROL)
35370 }
35371 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
35372 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
35373 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
35374 }
35375 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
35376 COMMAND_ACK_DATA::ID => {
35377 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
35378 }
35379 COMMAND_CANCEL_DATA::ID => {
35380 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
35381 }
35382 COMMAND_INT_DATA::ID => {
35383 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
35384 }
35385 COMMAND_INT_STAMPED_DATA::ID => {
35386 COMMAND_INT_STAMPED_DATA::deser(version, payload).map(Self::COMMAND_INT_STAMPED)
35387 }
35388 COMMAND_LONG_DATA::ID => {
35389 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
35390 }
35391 COMMAND_LONG_STAMPED_DATA::ID => {
35392 COMMAND_LONG_STAMPED_DATA::deser(version, payload).map(Self::COMMAND_LONG_STAMPED)
35393 }
35394 COMPONENT_INFORMATION_DATA::ID => {
35395 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
35396 }
35397 COMPONENT_INFORMATION_BASIC_DATA::ID => {
35398 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
35399 .map(Self::COMPONENT_INFORMATION_BASIC)
35400 }
35401 COMPONENT_METADATA_DATA::ID => {
35402 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
35403 }
35404 CONTROL_SYSTEM_STATE_DATA::ID => {
35405 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
35406 }
35407 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
35408 .map(Self::CURRENT_EVENT_SEQUENCE),
35409 CURRENT_MODE_DATA::ID => {
35410 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
35411 }
35412 DATA_STREAM_DATA::ID => {
35413 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
35414 }
35415 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
35416 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
35417 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
35418 }
35419 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
35420 DEBUG_FLOAT_ARRAY_DATA::ID => {
35421 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
35422 }
35423 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
35424 DISTANCE_SENSOR_DATA::ID => {
35425 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
35426 }
35427 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
35428 EKF_EXT_DATA::ID => EKF_EXT_DATA::deser(version, payload).map(Self::EKF_EXT),
35429 ENCAPSULATED_DATA_DATA::ID => {
35430 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
35431 }
35432 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
35433 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
35434 ESTIMATOR_STATUS_DATA::ID => {
35435 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
35436 }
35437 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
35438 EXTENDED_SYS_STATE_DATA::ID => {
35439 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
35440 }
35441 FENCE_STATUS_DATA::ID => {
35442 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
35443 }
35444 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
35445 .map(Self::FILE_TRANSFER_PROTOCOL),
35446 FLIGHT_INFORMATION_DATA::ID => {
35447 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
35448 }
35449 FOLLOW_TARGET_DATA::ID => {
35450 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
35451 }
35452 FUEL_STATUS_DATA::ID => {
35453 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
35454 }
35455 FW_SOARING_DATA_DATA::ID => {
35456 FW_SOARING_DATA_DATA::deser(version, payload).map(Self::FW_SOARING_DATA)
35457 }
35458 GENERATOR_STATUS_DATA::ID => {
35459 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
35460 }
35461 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
35462 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
35463 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
35464 }
35465 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
35466 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
35467 .map(Self::GIMBAL_DEVICE_INFORMATION)
35468 }
35469 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
35470 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
35471 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
35472 }
35473 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
35474 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
35475 .map(Self::GIMBAL_MANAGER_INFORMATION)
35476 }
35477 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
35478 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
35479 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
35480 }
35481 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35482 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
35483 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
35484 }
35485 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
35486 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
35487 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
35488 }
35489 GIMBAL_MANAGER_STATUS_DATA::ID => {
35490 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
35491 }
35492 GLOBAL_POSITION_INT_DATA::ID => {
35493 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
35494 }
35495 GLOBAL_POSITION_INT_COV_DATA::ID => {
35496 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
35497 .map(Self::GLOBAL_POSITION_INT_COV)
35498 }
35499 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35500 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
35501 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
35502 }
35503 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
35504 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
35505 GPS_GLOBAL_ORIGIN_DATA::ID => {
35506 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
35507 }
35508 GPS_INJECT_DATA_DATA::ID => {
35509 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
35510 }
35511 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
35512 GPS_RAW_INT_DATA::ID => {
35513 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
35514 }
35515 GPS_RTCM_DATA_DATA::ID => {
35516 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
35517 }
35518 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
35519 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
35520 GSM_LINK_STATUS_DATA::ID => {
35521 GSM_LINK_STATUS_DATA::deser(version, payload).map(Self::GSM_LINK_STATUS)
35522 }
35523 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
35524 HIGHRES_IMU_DATA::ID => {
35525 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
35526 }
35527 HIGH_LATENCY_DATA::ID => {
35528 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
35529 }
35530 HIGH_LATENCY2_DATA::ID => {
35531 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
35532 }
35533 HIL_ACTUATOR_CONTROLS_DATA::ID => {
35534 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
35535 }
35536 HIL_CONTROLS_DATA::ID => {
35537 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
35538 }
35539 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
35540 HIL_OPTICAL_FLOW_DATA::ID => {
35541 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
35542 }
35543 HIL_RC_INPUTS_RAW_DATA::ID => {
35544 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
35545 }
35546 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
35547 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
35548 HIL_STATE_QUATERNION_DATA::ID => {
35549 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
35550 }
35551 HOME_POSITION_DATA::ID => {
35552 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
35553 }
35554 HYGROMETER_SENSOR_DATA::ID => {
35555 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
35556 }
35557 ILLUMINATOR_STATUS_DATA::ID => {
35558 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
35559 }
35560 ISBD_LINK_STATUS_DATA::ID => {
35561 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
35562 }
35563 LANDING_TARGET_DATA::ID => {
35564 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
35565 }
35566 LINK_NODE_STATUS_DATA::ID => {
35567 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
35568 }
35569 LOCAL_POSITION_NED_DATA::ID => {
35570 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
35571 }
35572 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
35573 .map(Self::LOCAL_POSITION_NED_COV),
35574 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35575 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
35576 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
35577 }
35578 LOGGING_ACK_DATA::ID => {
35579 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
35580 }
35581 LOGGING_DATA_DATA::ID => {
35582 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
35583 }
35584 LOGGING_DATA_ACKED_DATA::ID => {
35585 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
35586 }
35587 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
35588 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
35589 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
35590 LOG_REQUEST_DATA_DATA::ID => {
35591 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
35592 }
35593 LOG_REQUEST_END_DATA::ID => {
35594 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
35595 }
35596 LOG_REQUEST_LIST_DATA::ID => {
35597 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
35598 }
35599 MAG_CAL_REPORT_DATA::ID => {
35600 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
35601 }
35602 MANUAL_CONTROL_DATA::ID => {
35603 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
35604 }
35605 MANUAL_SETPOINT_DATA::ID => {
35606 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
35607 }
35608 MEMORY_VECT_DATA::ID => {
35609 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
35610 }
35611 MESSAGE_INTERVAL_DATA::ID => {
35612 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
35613 }
35614 MISSION_ACK_DATA::ID => {
35615 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
35616 }
35617 MISSION_CLEAR_ALL_DATA::ID => {
35618 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
35619 }
35620 MISSION_COUNT_DATA::ID => {
35621 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
35622 }
35623 MISSION_CURRENT_DATA::ID => {
35624 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
35625 }
35626 MISSION_ITEM_DATA::ID => {
35627 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
35628 }
35629 MISSION_ITEM_INT_DATA::ID => {
35630 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
35631 }
35632 MISSION_ITEM_REACHED_DATA::ID => {
35633 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
35634 }
35635 MISSION_REQUEST_DATA::ID => {
35636 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
35637 }
35638 MISSION_REQUEST_INT_DATA::ID => {
35639 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
35640 }
35641 MISSION_REQUEST_LIST_DATA::ID => {
35642 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
35643 }
35644 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
35645 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
35646 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
35647 }
35648 MISSION_SET_CURRENT_DATA::ID => {
35649 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
35650 }
35651 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
35652 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
35653 .map(Self::MISSION_WRITE_PARTIAL_LIST)
35654 }
35655 MOUNT_ORIENTATION_DATA::ID => {
35656 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
35657 }
35658 NAMED_VALUE_FLOAT_DATA::ID => {
35659 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
35660 }
35661 NAMED_VALUE_INT_DATA::ID => {
35662 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
35663 }
35664 NAV_CONTROLLER_OUTPUT_DATA::ID => {
35665 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
35666 }
35667 OBSTACLE_DISTANCE_DATA::ID => {
35668 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
35669 }
35670 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
35671 ONBOARD_COMPUTER_STATUS_DATA::ID => {
35672 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
35673 .map(Self::ONBOARD_COMPUTER_STATUS)
35674 }
35675 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
35676 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
35677 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
35678 }
35679 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
35680 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
35681 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
35682 }
35683 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
35684 .map(Self::OPEN_DRONE_ID_BASIC_ID),
35685 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
35686 .map(Self::OPEN_DRONE_ID_LOCATION),
35687 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
35688 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
35689 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
35690 }
35691 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
35692 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
35693 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
35694 }
35695 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
35696 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
35697 }
35698 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
35699 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
35700 }
35701 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
35702 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
35703 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
35704 }
35705 OPTICAL_FLOW_DATA::ID => {
35706 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
35707 }
35708 OPTICAL_FLOW_RAD_DATA::ID => {
35709 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
35710 }
35711 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
35712 .map(Self::ORBIT_EXECUTION_STATUS),
35713 PARAM_EXT_ACK_DATA::ID => {
35714 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
35715 }
35716 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
35717 .map(Self::PARAM_EXT_REQUEST_LIST),
35718 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
35719 .map(Self::PARAM_EXT_REQUEST_READ),
35720 PARAM_EXT_SET_DATA::ID => {
35721 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
35722 }
35723 PARAM_EXT_VALUE_DATA::ID => {
35724 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
35725 }
35726 PARAM_MAP_RC_DATA::ID => {
35727 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
35728 }
35729 PARAM_REQUEST_LIST_DATA::ID => {
35730 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
35731 }
35732 PARAM_REQUEST_READ_DATA::ID => {
35733 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
35734 }
35735 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
35736 PARAM_VALUE_DATA::ID => {
35737 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
35738 }
35739 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
35740 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
35741 PLAY_TUNE_V2_DATA::ID => {
35742 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
35743 }
35744 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
35745 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
35746 .map(Self::POSITION_TARGET_GLOBAL_INT)
35747 }
35748 POSITION_TARGET_LOCAL_NED_DATA::ID => {
35749 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
35750 .map(Self::POSITION_TARGET_LOCAL_NED)
35751 }
35752 POWER_STATUS_DATA::ID => {
35753 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
35754 }
35755 PROTOCOL_VERSION_DATA::ID => {
35756 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
35757 }
35758 RADIO_STATUS_DATA::ID => {
35759 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
35760 }
35761 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
35762 RAW_PRESSURE_DATA::ID => {
35763 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
35764 }
35765 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
35766 RC_CHANNELS_DATA::ID => {
35767 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
35768 }
35769 RC_CHANNELS_OVERRIDE_DATA::ID => {
35770 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
35771 }
35772 RC_CHANNELS_RAW_DATA::ID => {
35773 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
35774 }
35775 RC_CHANNELS_SCALED_DATA::ID => {
35776 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
35777 }
35778 REQUEST_DATA_STREAM_DATA::ID => {
35779 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
35780 }
35781 REQUEST_EVENT_DATA::ID => {
35782 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
35783 }
35784 RESOURCE_REQUEST_DATA::ID => {
35785 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
35786 }
35787 RESPONSE_EVENT_ERROR_DATA::ID => {
35788 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
35789 }
35790 SAFETY_ALLOWED_AREA_DATA::ID => {
35791 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
35792 }
35793 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
35794 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
35795 .map(Self::SAFETY_SET_ALLOWED_AREA)
35796 }
35797 SATCOM_LINK_STATUS_DATA::ID => {
35798 SATCOM_LINK_STATUS_DATA::deser(version, payload).map(Self::SATCOM_LINK_STATUS)
35799 }
35800 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
35801 SCALED_IMU2_DATA::ID => {
35802 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
35803 }
35804 SCALED_IMU3_DATA::ID => {
35805 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
35806 }
35807 SCALED_PRESSURE_DATA::ID => {
35808 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
35809 }
35810 SCALED_PRESSURE2_DATA::ID => {
35811 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
35812 }
35813 SCALED_PRESSURE3_DATA::ID => {
35814 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
35815 }
35816 SENSORPOD_STATUS_DATA::ID => {
35817 SENSORPOD_STATUS_DATA::deser(version, payload).map(Self::SENSORPOD_STATUS)
35818 }
35819 SENSOR_AIRFLOW_ANGLES_DATA::ID => {
35820 SENSOR_AIRFLOW_ANGLES_DATA::deser(version, payload).map(Self::SENSOR_AIRFLOW_ANGLES)
35821 }
35822 SENS_ATMOS_DATA::ID => SENS_ATMOS_DATA::deser(version, payload).map(Self::SENS_ATMOS),
35823 SENS_BATMON_DATA::ID => {
35824 SENS_BATMON_DATA::deser(version, payload).map(Self::SENS_BATMON)
35825 }
35826 SENS_MPPT_DATA::ID => SENS_MPPT_DATA::deser(version, payload).map(Self::SENS_MPPT),
35827 SENS_POWER_DATA::ID => SENS_POWER_DATA::deser(version, payload).map(Self::SENS_POWER),
35828 SENS_POWER_BOARD_DATA::ID => {
35829 SENS_POWER_BOARD_DATA::deser(version, payload).map(Self::SENS_POWER_BOARD)
35830 }
35831 SERIAL_CONTROL_DATA::ID => {
35832 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
35833 }
35834 SERVO_OUTPUT_RAW_DATA::ID => {
35835 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
35836 }
35837 SETUP_SIGNING_DATA::ID => {
35838 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
35839 }
35840 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
35841 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
35842 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
35843 }
35844 SET_ATTITUDE_TARGET_DATA::ID => {
35845 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
35846 }
35847 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
35848 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
35849 }
35850 SET_HOME_POSITION_DATA::ID => {
35851 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
35852 }
35853 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
35854 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
35855 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
35856 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
35857 }
35858 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
35859 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
35860 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
35861 }
35862 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
35863 SMART_BATTERY_INFO_DATA::ID => {
35864 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
35865 }
35866 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
35867 STORAGE_INFORMATION_DATA::ID => {
35868 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
35869 }
35870 SUPPORTED_TUNES_DATA::ID => {
35871 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
35872 }
35873 SYSTEM_TIME_DATA::ID => {
35874 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
35875 }
35876 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
35877 TERRAIN_CHECK_DATA::ID => {
35878 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
35879 }
35880 TERRAIN_DATA_DATA::ID => {
35881 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
35882 }
35883 TERRAIN_REPORT_DATA::ID => {
35884 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
35885 }
35886 TERRAIN_REQUEST_DATA::ID => {
35887 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
35888 }
35889 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
35890 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
35891 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
35892 .map(Self::TIME_ESTIMATE_TO_TARGET)
35893 }
35894 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35895 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
35896 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
35897 }
35898 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35899 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
35900 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
35901 }
35902 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
35903 UAVCAN_NODE_INFO_DATA::ID => {
35904 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
35905 }
35906 UAVCAN_NODE_STATUS_DATA::ID => {
35907 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
35908 }
35909 UTM_GLOBAL_POSITION_DATA::ID => {
35910 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
35911 }
35912 V2_EXTENSION_DATA::ID => {
35913 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
35914 }
35915 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
35916 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
35917 VICON_POSITION_ESTIMATE_DATA::ID => {
35918 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
35919 .map(Self::VICON_POSITION_ESTIMATE)
35920 }
35921 VIDEO_STREAM_INFORMATION_DATA::ID => {
35922 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
35923 .map(Self::VIDEO_STREAM_INFORMATION)
35924 }
35925 VIDEO_STREAM_STATUS_DATA::ID => {
35926 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
35927 }
35928 VISION_POSITION_ESTIMATE_DATA::ID => {
35929 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
35930 .map(Self::VISION_POSITION_ESTIMATE)
35931 }
35932 VISION_SPEED_ESTIMATE_DATA::ID => {
35933 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
35934 }
35935 WHEEL_DISTANCE_DATA::ID => {
35936 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
35937 }
35938 WIFI_CONFIG_AP_DATA::ID => {
35939 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
35940 }
35941 WINCH_STATUS_DATA::ID => {
35942 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
35943 }
35944 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
35945 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
35946 }
35947 }
35948 fn message_name(&self) -> &'static str {
35949 match self {
35950 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
35951 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
35952 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
35953 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
35954 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
35955 Self::ASLCTRL_DATA(..) => ASLCTRL_DATA_DATA::NAME,
35956 Self::ASLCTRL_DEBUG(..) => ASLCTRL_DEBUG_DATA::NAME,
35957 Self::ASLUAV_STATUS(..) => ASLUAV_STATUS_DATA::NAME,
35958 Self::ASL_OBCTRL(..) => ASL_OBCTRL_DATA::NAME,
35959 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
35960 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
35961 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
35962 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
35963 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
35964 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
35965 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
35966 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
35967 }
35968 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
35969 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
35970 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
35971 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
35972 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
35973 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
35974 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
35975 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
35976 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
35977 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
35978 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
35979 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
35980 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
35981 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
35982 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
35983 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
35984 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
35985 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
35986 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
35987 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
35988 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
35989 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
35990 Self::COLLISION(..) => COLLISION_DATA::NAME,
35991 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
35992 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
35993 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
35994 Self::COMMAND_INT_STAMPED(..) => COMMAND_INT_STAMPED_DATA::NAME,
35995 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
35996 Self::COMMAND_LONG_STAMPED(..) => COMMAND_LONG_STAMPED_DATA::NAME,
35997 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
35998 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
35999 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
36000 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
36001 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
36002 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
36003 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
36004 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
36005 Self::DEBUG(..) => DEBUG_DATA::NAME,
36006 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
36007 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
36008 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
36009 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
36010 Self::EKF_EXT(..) => EKF_EXT_DATA::NAME,
36011 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
36012 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
36013 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
36014 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
36015 Self::EVENT(..) => EVENT_DATA::NAME,
36016 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
36017 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
36018 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
36019 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
36020 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
36021 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
36022 Self::FW_SOARING_DATA(..) => FW_SOARING_DATA_DATA::NAME,
36023 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
36024 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
36025 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
36026 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
36027 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
36028 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
36029 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
36030 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
36031 }
36032 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
36033 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
36034 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
36035 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
36036 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
36037 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
36038 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
36039 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
36040 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
36041 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
36042 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
36043 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
36044 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
36045 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
36046 Self::GSM_LINK_STATUS(..) => GSM_LINK_STATUS_DATA::NAME,
36047 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
36048 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
36049 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
36050 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
36051 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
36052 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
36053 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
36054 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
36055 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
36056 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
36057 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
36058 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
36059 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
36060 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
36061 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
36062 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
36063 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
36064 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
36065 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
36066 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
36067 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
36068 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
36069 }
36070 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
36071 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
36072 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
36073 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
36074 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
36075 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
36076 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
36077 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
36078 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
36079 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
36080 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
36081 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
36082 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
36083 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
36084 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
36085 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
36086 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
36087 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
36088 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
36089 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
36090 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
36091 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
36092 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
36093 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
36094 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
36095 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
36096 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
36097 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
36098 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
36099 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
36100 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
36101 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
36102 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
36103 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
36104 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
36105 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
36106 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
36107 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
36108 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
36109 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
36110 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
36111 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
36112 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
36113 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
36114 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
36115 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
36116 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
36117 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
36118 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
36119 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
36120 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
36121 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
36122 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
36123 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
36124 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
36125 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
36126 Self::PING(..) => PING_DATA::NAME,
36127 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
36128 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
36129 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
36130 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
36131 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
36132 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
36133 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
36134 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
36135 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
36136 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
36137 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
36138 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
36139 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
36140 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
36141 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
36142 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
36143 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
36144 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
36145 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
36146 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
36147 Self::SATCOM_LINK_STATUS(..) => SATCOM_LINK_STATUS_DATA::NAME,
36148 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
36149 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
36150 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
36151 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
36152 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
36153 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
36154 Self::SENSORPOD_STATUS(..) => SENSORPOD_STATUS_DATA::NAME,
36155 Self::SENSOR_AIRFLOW_ANGLES(..) => SENSOR_AIRFLOW_ANGLES_DATA::NAME,
36156 Self::SENS_ATMOS(..) => SENS_ATMOS_DATA::NAME,
36157 Self::SENS_BATMON(..) => SENS_BATMON_DATA::NAME,
36158 Self::SENS_MPPT(..) => SENS_MPPT_DATA::NAME,
36159 Self::SENS_POWER(..) => SENS_POWER_DATA::NAME,
36160 Self::SENS_POWER_BOARD(..) => SENS_POWER_BOARD_DATA::NAME,
36161 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
36162 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
36163 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
36164 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
36165 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
36166 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
36167 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
36168 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
36169 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
36170 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
36171 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
36172 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
36173 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
36174 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
36175 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
36176 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
36177 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
36178 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
36179 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
36180 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
36181 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
36182 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
36183 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
36184 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
36185 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
36186 }
36187 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
36188 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
36189 }
36190 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
36191 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
36192 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
36193 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
36194 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
36195 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
36196 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
36197 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
36198 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
36199 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
36200 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
36201 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
36202 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
36203 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
36204 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
36205 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
36206 }
36207 }
36208 fn message_id(&self) -> u32 {
36209 match self {
36210 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
36211 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
36212 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
36213 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
36214 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
36215 Self::ASLCTRL_DATA(..) => ASLCTRL_DATA_DATA::ID,
36216 Self::ASLCTRL_DEBUG(..) => ASLCTRL_DEBUG_DATA::ID,
36217 Self::ASLUAV_STATUS(..) => ASLUAV_STATUS_DATA::ID,
36218 Self::ASL_OBCTRL(..) => ASL_OBCTRL_DATA::ID,
36219 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
36220 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
36221 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
36222 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
36223 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
36224 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
36225 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
36226 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
36227 }
36228 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
36229 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
36230 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
36231 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
36232 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
36233 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
36234 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
36235 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
36236 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
36237 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
36238 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
36239 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
36240 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
36241 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
36242 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
36243 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
36244 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
36245 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
36246 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
36247 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
36248 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
36249 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
36250 Self::COLLISION(..) => COLLISION_DATA::ID,
36251 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
36252 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
36253 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
36254 Self::COMMAND_INT_STAMPED(..) => COMMAND_INT_STAMPED_DATA::ID,
36255 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
36256 Self::COMMAND_LONG_STAMPED(..) => COMMAND_LONG_STAMPED_DATA::ID,
36257 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
36258 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
36259 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
36260 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
36261 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
36262 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
36263 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
36264 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
36265 Self::DEBUG(..) => DEBUG_DATA::ID,
36266 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
36267 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
36268 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
36269 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
36270 Self::EKF_EXT(..) => EKF_EXT_DATA::ID,
36271 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
36272 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
36273 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
36274 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
36275 Self::EVENT(..) => EVENT_DATA::ID,
36276 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
36277 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
36278 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
36279 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
36280 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
36281 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
36282 Self::FW_SOARING_DATA(..) => FW_SOARING_DATA_DATA::ID,
36283 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
36284 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
36285 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
36286 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
36287 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
36288 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
36289 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
36290 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
36291 }
36292 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
36293 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
36294 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
36295 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
36296 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
36297 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
36298 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
36299 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
36300 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
36301 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
36302 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
36303 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
36304 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
36305 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
36306 Self::GSM_LINK_STATUS(..) => GSM_LINK_STATUS_DATA::ID,
36307 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
36308 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
36309 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
36310 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
36311 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
36312 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
36313 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
36314 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
36315 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
36316 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
36317 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
36318 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
36319 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
36320 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
36321 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
36322 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
36323 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
36324 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
36325 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
36326 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
36327 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
36328 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
36329 }
36330 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
36331 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
36332 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
36333 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
36334 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
36335 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
36336 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
36337 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
36338 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
36339 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
36340 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
36341 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
36342 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
36343 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
36344 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
36345 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
36346 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
36347 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
36348 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
36349 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
36350 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
36351 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
36352 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
36353 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
36354 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
36355 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
36356 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
36357 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
36358 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
36359 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
36360 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
36361 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
36362 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
36363 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
36364 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
36365 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
36366 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
36367 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
36368 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
36369 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
36370 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
36371 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
36372 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
36373 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
36374 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
36375 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
36376 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
36377 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
36378 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
36379 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
36380 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
36381 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
36382 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
36383 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
36384 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
36385 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
36386 Self::PING(..) => PING_DATA::ID,
36387 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
36388 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
36389 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
36390 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
36391 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
36392 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
36393 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
36394 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
36395 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
36396 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
36397 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
36398 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
36399 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
36400 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
36401 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
36402 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
36403 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
36404 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
36405 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
36406 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
36407 Self::SATCOM_LINK_STATUS(..) => SATCOM_LINK_STATUS_DATA::ID,
36408 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
36409 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
36410 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
36411 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
36412 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
36413 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
36414 Self::SENSORPOD_STATUS(..) => SENSORPOD_STATUS_DATA::ID,
36415 Self::SENSOR_AIRFLOW_ANGLES(..) => SENSOR_AIRFLOW_ANGLES_DATA::ID,
36416 Self::SENS_ATMOS(..) => SENS_ATMOS_DATA::ID,
36417 Self::SENS_BATMON(..) => SENS_BATMON_DATA::ID,
36418 Self::SENS_MPPT(..) => SENS_MPPT_DATA::ID,
36419 Self::SENS_POWER(..) => SENS_POWER_DATA::ID,
36420 Self::SENS_POWER_BOARD(..) => SENS_POWER_BOARD_DATA::ID,
36421 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
36422 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
36423 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
36424 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
36425 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
36426 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
36427 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
36428 Self::SET_MODE(..) => SET_MODE_DATA::ID,
36429 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
36430 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
36431 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
36432 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
36433 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
36434 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
36435 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
36436 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
36437 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
36438 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
36439 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
36440 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
36441 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
36442 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
36443 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
36444 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
36445 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
36446 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
36447 }
36448 Self::TUNNEL(..) => TUNNEL_DATA::ID,
36449 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
36450 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
36451 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
36452 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
36453 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
36454 Self::VIBRATION(..) => VIBRATION_DATA::ID,
36455 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
36456 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
36457 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
36458 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
36459 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
36460 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
36461 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
36462 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
36463 Self::WIND_COV(..) => WIND_COV_DATA::ID,
36464 }
36465 }
36466 fn message_id_from_name(name: &str) -> Option<u32> {
36467 match name {
36468 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
36469 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
36470 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
36471 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
36472 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
36473 ASLCTRL_DATA_DATA::NAME => Some(ASLCTRL_DATA_DATA::ID),
36474 ASLCTRL_DEBUG_DATA::NAME => Some(ASLCTRL_DEBUG_DATA::ID),
36475 ASLUAV_STATUS_DATA::NAME => Some(ASLUAV_STATUS_DATA::ID),
36476 ASL_OBCTRL_DATA::NAME => Some(ASL_OBCTRL_DATA::ID),
36477 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
36478 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
36479 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
36480 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
36481 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
36482 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
36483 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
36484 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
36485 }
36486 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
36487 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
36488 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
36489 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
36490 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
36491 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
36492 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
36493 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
36494 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
36495 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
36496 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
36497 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
36498 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
36499 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
36500 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
36501 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
36502 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
36503 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
36504 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
36505 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
36506 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
36507 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
36508 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
36509 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
36510 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
36511 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
36512 COMMAND_INT_STAMPED_DATA::NAME => Some(COMMAND_INT_STAMPED_DATA::ID),
36513 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
36514 COMMAND_LONG_STAMPED_DATA::NAME => Some(COMMAND_LONG_STAMPED_DATA::ID),
36515 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
36516 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
36517 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
36518 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
36519 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
36520 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
36521 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
36522 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
36523 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
36524 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
36525 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
36526 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
36527 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
36528 EKF_EXT_DATA::NAME => Some(EKF_EXT_DATA::ID),
36529 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
36530 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
36531 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
36532 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
36533 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
36534 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
36535 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
36536 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
36537 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
36538 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
36539 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
36540 FW_SOARING_DATA_DATA::NAME => Some(FW_SOARING_DATA_DATA::ID),
36541 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
36542 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
36543 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
36544 }
36545 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
36546 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
36547 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
36548 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
36549 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
36550 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
36551 }
36552 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
36553 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
36554 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
36555 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
36556 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
36557 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
36558 }
36559 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
36560 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
36561 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
36562 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
36563 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
36564 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
36565 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
36566 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
36567 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
36568 GSM_LINK_STATUS_DATA::NAME => Some(GSM_LINK_STATUS_DATA::ID),
36569 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
36570 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
36571 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
36572 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
36573 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
36574 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
36575 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
36576 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
36577 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
36578 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
36579 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
36580 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
36581 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
36582 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
36583 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
36584 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
36585 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
36586 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
36587 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
36588 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
36589 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
36590 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
36591 }
36592 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
36593 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
36594 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
36595 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
36596 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
36597 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
36598 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
36599 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
36600 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
36601 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
36602 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
36603 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
36604 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
36605 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
36606 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
36607 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
36608 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
36609 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
36610 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
36611 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
36612 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
36613 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
36614 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
36615 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
36616 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
36617 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
36618 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
36619 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
36620 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
36621 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
36622 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
36623 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
36624 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
36625 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
36626 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
36627 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
36628 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
36629 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
36630 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
36631 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
36632 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
36633 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
36634 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
36635 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
36636 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
36637 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
36638 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
36639 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
36640 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
36641 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
36642 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
36643 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
36644 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
36645 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
36646 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
36647 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
36648 PING_DATA::NAME => Some(PING_DATA::ID),
36649 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
36650 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
36651 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
36652 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
36653 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
36654 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
36655 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
36656 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
36657 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
36658 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
36659 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
36660 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
36661 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
36662 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
36663 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
36664 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
36665 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
36666 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
36667 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
36668 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
36669 SATCOM_LINK_STATUS_DATA::NAME => Some(SATCOM_LINK_STATUS_DATA::ID),
36670 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
36671 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
36672 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
36673 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
36674 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
36675 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
36676 SENSORPOD_STATUS_DATA::NAME => Some(SENSORPOD_STATUS_DATA::ID),
36677 SENSOR_AIRFLOW_ANGLES_DATA::NAME => Some(SENSOR_AIRFLOW_ANGLES_DATA::ID),
36678 SENS_ATMOS_DATA::NAME => Some(SENS_ATMOS_DATA::ID),
36679 SENS_BATMON_DATA::NAME => Some(SENS_BATMON_DATA::ID),
36680 SENS_MPPT_DATA::NAME => Some(SENS_MPPT_DATA::ID),
36681 SENS_POWER_DATA::NAME => Some(SENS_POWER_DATA::ID),
36682 SENS_POWER_BOARD_DATA::NAME => Some(SENS_POWER_BOARD_DATA::ID),
36683 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
36684 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
36685 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
36686 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
36687 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
36688 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
36689 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
36690 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
36691 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
36692 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
36693 }
36694 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
36695 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
36696 }
36697 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
36698 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
36699 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
36700 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
36701 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
36702 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
36703 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
36704 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
36705 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
36706 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
36707 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
36708 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
36709 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
36710 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
36711 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
36712 }
36713 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
36714 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
36715 }
36716 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
36717 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
36718 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
36719 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
36720 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
36721 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
36722 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
36723 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
36724 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
36725 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
36726 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
36727 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
36728 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
36729 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
36730 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
36731 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
36732 _ => None,
36733 }
36734 }
36735 fn default_message_from_id(id: u32) -> Option<Self> {
36736 match id {
36737 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
36738 ACTUATOR_CONTROL_TARGET_DATA::default(),
36739 )),
36740 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
36741 ACTUATOR_OUTPUT_STATUS_DATA::default(),
36742 )),
36743 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
36744 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
36745 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
36746 ASLCTRL_DATA_DATA::ID => Some(Self::ASLCTRL_DATA(ASLCTRL_DATA_DATA::default())),
36747 ASLCTRL_DEBUG_DATA::ID => Some(Self::ASLCTRL_DEBUG(ASLCTRL_DEBUG_DATA::default())),
36748 ASLUAV_STATUS_DATA::ID => Some(Self::ASLUAV_STATUS(ASLUAV_STATUS_DATA::default())),
36749 ASL_OBCTRL_DATA::ID => Some(Self::ASL_OBCTRL(ASL_OBCTRL_DATA::default())),
36750 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
36751 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
36752 ATTITUDE_QUATERNION_DATA::default(),
36753 )),
36754 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
36755 ATTITUDE_QUATERNION_COV_DATA::default(),
36756 )),
36757 ATTITUDE_TARGET_DATA::ID => {
36758 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
36759 }
36760 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
36761 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
36762 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36763 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
36764 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
36765 ))
36766 }
36767 AUTOPILOT_VERSION_DATA::ID => {
36768 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
36769 }
36770 AVAILABLE_MODES_DATA::ID => {
36771 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
36772 }
36773 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
36774 AVAILABLE_MODES_MONITOR_DATA::default(),
36775 )),
36776 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
36777 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
36778 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
36779 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
36780 CAMERA_CAPTURE_STATUS_DATA::default(),
36781 )),
36782 CAMERA_FOV_STATUS_DATA::ID => {
36783 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
36784 }
36785 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
36786 CAMERA_IMAGE_CAPTURED_DATA::default(),
36787 )),
36788 CAMERA_INFORMATION_DATA::ID => {
36789 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
36790 }
36791 CAMERA_SETTINGS_DATA::ID => {
36792 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
36793 }
36794 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
36795 CAMERA_THERMAL_RANGE_DATA::default(),
36796 )),
36797 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
36798 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
36799 )),
36800 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
36801 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
36802 )),
36803 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
36804 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
36805 CAN_FILTER_MODIFY_DATA::ID => {
36806 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
36807 }
36808 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
36809 CELLULAR_CONFIG_DATA::ID => {
36810 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
36811 }
36812 CELLULAR_STATUS_DATA::ID => {
36813 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
36814 }
36815 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
36816 CHANGE_OPERATOR_CONTROL_DATA::default(),
36817 )),
36818 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
36819 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
36820 )),
36821 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
36822 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
36823 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
36824 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
36825 COMMAND_INT_STAMPED_DATA::ID => Some(Self::COMMAND_INT_STAMPED(
36826 COMMAND_INT_STAMPED_DATA::default(),
36827 )),
36828 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
36829 COMMAND_LONG_STAMPED_DATA::ID => Some(Self::COMMAND_LONG_STAMPED(
36830 COMMAND_LONG_STAMPED_DATA::default(),
36831 )),
36832 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
36833 COMPONENT_INFORMATION_DATA::default(),
36834 )),
36835 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
36836 COMPONENT_INFORMATION_BASIC_DATA::default(),
36837 )),
36838 COMPONENT_METADATA_DATA::ID => {
36839 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
36840 }
36841 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
36842 CONTROL_SYSTEM_STATE_DATA::default(),
36843 )),
36844 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
36845 CURRENT_EVENT_SEQUENCE_DATA::default(),
36846 )),
36847 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
36848 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
36849 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
36850 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
36851 )),
36852 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
36853 DEBUG_FLOAT_ARRAY_DATA::ID => {
36854 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
36855 }
36856 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
36857 DISTANCE_SENSOR_DATA::ID => {
36858 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
36859 }
36860 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
36861 EKF_EXT_DATA::ID => Some(Self::EKF_EXT(EKF_EXT_DATA::default())),
36862 ENCAPSULATED_DATA_DATA::ID => {
36863 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
36864 }
36865 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
36866 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
36867 ESTIMATOR_STATUS_DATA::ID => {
36868 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
36869 }
36870 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
36871 EXTENDED_SYS_STATE_DATA::ID => {
36872 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
36873 }
36874 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
36875 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
36876 FILE_TRANSFER_PROTOCOL_DATA::default(),
36877 )),
36878 FLIGHT_INFORMATION_DATA::ID => {
36879 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
36880 }
36881 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
36882 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
36883 FW_SOARING_DATA_DATA::ID => {
36884 Some(Self::FW_SOARING_DATA(FW_SOARING_DATA_DATA::default()))
36885 }
36886 GENERATOR_STATUS_DATA::ID => {
36887 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
36888 }
36889 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
36890 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
36891 )),
36892 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
36893 GIMBAL_DEVICE_INFORMATION_DATA::default(),
36894 )),
36895 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
36896 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
36897 )),
36898 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
36899 GIMBAL_MANAGER_INFORMATION_DATA::default(),
36900 )),
36901 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
36902 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
36903 )),
36904 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36905 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
36906 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
36907 ))
36908 }
36909 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
36910 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
36911 )),
36912 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
36913 GIMBAL_MANAGER_STATUS_DATA::default(),
36914 )),
36915 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
36916 GLOBAL_POSITION_INT_DATA::default(),
36917 )),
36918 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
36919 GLOBAL_POSITION_INT_COV_DATA::default(),
36920 )),
36921 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36922 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
36923 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
36924 ))
36925 }
36926 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
36927 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
36928 GPS_GLOBAL_ORIGIN_DATA::ID => {
36929 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
36930 }
36931 GPS_INJECT_DATA_DATA::ID => {
36932 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
36933 }
36934 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
36935 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
36936 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
36937 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
36938 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
36939 GSM_LINK_STATUS_DATA::ID => {
36940 Some(Self::GSM_LINK_STATUS(GSM_LINK_STATUS_DATA::default()))
36941 }
36942 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
36943 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
36944 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
36945 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
36946 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
36947 HIL_ACTUATOR_CONTROLS_DATA::default(),
36948 )),
36949 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
36950 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
36951 HIL_OPTICAL_FLOW_DATA::ID => {
36952 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
36953 }
36954 HIL_RC_INPUTS_RAW_DATA::ID => {
36955 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
36956 }
36957 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
36958 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
36959 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
36960 HIL_STATE_QUATERNION_DATA::default(),
36961 )),
36962 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
36963 HYGROMETER_SENSOR_DATA::ID => {
36964 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
36965 }
36966 ILLUMINATOR_STATUS_DATA::ID => {
36967 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
36968 }
36969 ISBD_LINK_STATUS_DATA::ID => {
36970 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
36971 }
36972 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
36973 LINK_NODE_STATUS_DATA::ID => {
36974 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
36975 }
36976 LOCAL_POSITION_NED_DATA::ID => {
36977 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
36978 }
36979 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
36980 LOCAL_POSITION_NED_COV_DATA::default(),
36981 )),
36982 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36983 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
36984 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
36985 ))
36986 }
36987 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
36988 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
36989 LOGGING_DATA_ACKED_DATA::ID => {
36990 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
36991 }
36992 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
36993 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
36994 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
36995 LOG_REQUEST_DATA_DATA::ID => {
36996 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
36997 }
36998 LOG_REQUEST_END_DATA::ID => {
36999 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
37000 }
37001 LOG_REQUEST_LIST_DATA::ID => {
37002 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
37003 }
37004 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
37005 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
37006 MANUAL_SETPOINT_DATA::ID => {
37007 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
37008 }
37009 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
37010 MESSAGE_INTERVAL_DATA::ID => {
37011 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
37012 }
37013 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
37014 MISSION_CLEAR_ALL_DATA::ID => {
37015 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
37016 }
37017 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
37018 MISSION_CURRENT_DATA::ID => {
37019 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
37020 }
37021 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
37022 MISSION_ITEM_INT_DATA::ID => {
37023 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
37024 }
37025 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
37026 MISSION_ITEM_REACHED_DATA::default(),
37027 )),
37028 MISSION_REQUEST_DATA::ID => {
37029 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
37030 }
37031 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
37032 MISSION_REQUEST_INT_DATA::default(),
37033 )),
37034 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
37035 MISSION_REQUEST_LIST_DATA::default(),
37036 )),
37037 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
37038 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
37039 )),
37040 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
37041 MISSION_SET_CURRENT_DATA::default(),
37042 )),
37043 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
37044 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
37045 )),
37046 MOUNT_ORIENTATION_DATA::ID => {
37047 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
37048 }
37049 NAMED_VALUE_FLOAT_DATA::ID => {
37050 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
37051 }
37052 NAMED_VALUE_INT_DATA::ID => {
37053 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
37054 }
37055 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
37056 NAV_CONTROLLER_OUTPUT_DATA::default(),
37057 )),
37058 OBSTACLE_DISTANCE_DATA::ID => {
37059 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
37060 }
37061 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
37062 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
37063 ONBOARD_COMPUTER_STATUS_DATA::default(),
37064 )),
37065 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
37066 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
37067 )),
37068 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
37069 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
37070 )),
37071 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
37072 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
37073 )),
37074 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
37075 OPEN_DRONE_ID_LOCATION_DATA::default(),
37076 )),
37077 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
37078 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
37079 )),
37080 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
37081 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
37082 )),
37083 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
37084 OPEN_DRONE_ID_SELF_ID_DATA::default(),
37085 )),
37086 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
37087 OPEN_DRONE_ID_SYSTEM_DATA::default(),
37088 )),
37089 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
37090 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
37091 )),
37092 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
37093 OPTICAL_FLOW_RAD_DATA::ID => {
37094 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
37095 }
37096 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
37097 ORBIT_EXECUTION_STATUS_DATA::default(),
37098 )),
37099 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
37100 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
37101 PARAM_EXT_REQUEST_LIST_DATA::default(),
37102 )),
37103 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
37104 PARAM_EXT_REQUEST_READ_DATA::default(),
37105 )),
37106 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
37107 PARAM_EXT_VALUE_DATA::ID => {
37108 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
37109 }
37110 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
37111 PARAM_REQUEST_LIST_DATA::ID => {
37112 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
37113 }
37114 PARAM_REQUEST_READ_DATA::ID => {
37115 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
37116 }
37117 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
37118 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
37119 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
37120 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
37121 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
37122 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
37123 POSITION_TARGET_GLOBAL_INT_DATA::default(),
37124 )),
37125 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
37126 POSITION_TARGET_LOCAL_NED_DATA::default(),
37127 )),
37128 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
37129 PROTOCOL_VERSION_DATA::ID => {
37130 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
37131 }
37132 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
37133 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
37134 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
37135 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
37136 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
37137 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
37138 RC_CHANNELS_OVERRIDE_DATA::default(),
37139 )),
37140 RC_CHANNELS_RAW_DATA::ID => {
37141 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
37142 }
37143 RC_CHANNELS_SCALED_DATA::ID => {
37144 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
37145 }
37146 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
37147 REQUEST_DATA_STREAM_DATA::default(),
37148 )),
37149 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
37150 RESOURCE_REQUEST_DATA::ID => {
37151 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
37152 }
37153 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
37154 RESPONSE_EVENT_ERROR_DATA::default(),
37155 )),
37156 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
37157 SAFETY_ALLOWED_AREA_DATA::default(),
37158 )),
37159 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
37160 SAFETY_SET_ALLOWED_AREA_DATA::default(),
37161 )),
37162 SATCOM_LINK_STATUS_DATA::ID => {
37163 Some(Self::SATCOM_LINK_STATUS(SATCOM_LINK_STATUS_DATA::default()))
37164 }
37165 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
37166 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
37167 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
37168 SCALED_PRESSURE_DATA::ID => {
37169 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
37170 }
37171 SCALED_PRESSURE2_DATA::ID => {
37172 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
37173 }
37174 SCALED_PRESSURE3_DATA::ID => {
37175 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
37176 }
37177 SENSORPOD_STATUS_DATA::ID => {
37178 Some(Self::SENSORPOD_STATUS(SENSORPOD_STATUS_DATA::default()))
37179 }
37180 SENSOR_AIRFLOW_ANGLES_DATA::ID => Some(Self::SENSOR_AIRFLOW_ANGLES(
37181 SENSOR_AIRFLOW_ANGLES_DATA::default(),
37182 )),
37183 SENS_ATMOS_DATA::ID => Some(Self::SENS_ATMOS(SENS_ATMOS_DATA::default())),
37184 SENS_BATMON_DATA::ID => Some(Self::SENS_BATMON(SENS_BATMON_DATA::default())),
37185 SENS_MPPT_DATA::ID => Some(Self::SENS_MPPT(SENS_MPPT_DATA::default())),
37186 SENS_POWER_DATA::ID => Some(Self::SENS_POWER(SENS_POWER_DATA::default())),
37187 SENS_POWER_BOARD_DATA::ID => {
37188 Some(Self::SENS_POWER_BOARD(SENS_POWER_BOARD_DATA::default()))
37189 }
37190 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
37191 SERVO_OUTPUT_RAW_DATA::ID => {
37192 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
37193 }
37194 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
37195 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
37196 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
37197 )),
37198 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
37199 SET_ATTITUDE_TARGET_DATA::default(),
37200 )),
37201 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
37202 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
37203 )),
37204 SET_HOME_POSITION_DATA::ID => {
37205 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
37206 }
37207 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
37208 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
37209 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
37210 )),
37211 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
37212 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
37213 )),
37214 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
37215 SMART_BATTERY_INFO_DATA::ID => {
37216 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
37217 }
37218 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
37219 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
37220 STORAGE_INFORMATION_DATA::default(),
37221 )),
37222 SUPPORTED_TUNES_DATA::ID => {
37223 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
37224 }
37225 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
37226 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
37227 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
37228 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
37229 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
37230 TERRAIN_REQUEST_DATA::ID => {
37231 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
37232 }
37233 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
37234 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
37235 TIME_ESTIMATE_TO_TARGET_DATA::default(),
37236 )),
37237 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
37238 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
37239 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
37240 ))
37241 }
37242 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
37243 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
37244 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
37245 ))
37246 }
37247 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
37248 UAVCAN_NODE_INFO_DATA::ID => {
37249 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
37250 }
37251 UAVCAN_NODE_STATUS_DATA::ID => {
37252 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
37253 }
37254 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
37255 UTM_GLOBAL_POSITION_DATA::default(),
37256 )),
37257 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
37258 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
37259 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
37260 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
37261 VICON_POSITION_ESTIMATE_DATA::default(),
37262 )),
37263 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
37264 VIDEO_STREAM_INFORMATION_DATA::default(),
37265 )),
37266 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
37267 VIDEO_STREAM_STATUS_DATA::default(),
37268 )),
37269 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
37270 VISION_POSITION_ESTIMATE_DATA::default(),
37271 )),
37272 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
37273 VISION_SPEED_ESTIMATE_DATA::default(),
37274 )),
37275 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
37276 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
37277 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
37278 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
37279 _ => None,
37280 }
37281 }
37282 #[cfg(feature = "arbitrary")]
37283 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
37284 match id {
37285 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
37286 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
37287 )),
37288 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
37289 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
37290 )),
37291 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
37292 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
37293 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
37294 ASLCTRL_DATA_DATA::ID => Some(Self::ASLCTRL_DATA(ASLCTRL_DATA_DATA::random(rng))),
37295 ASLCTRL_DEBUG_DATA::ID => Some(Self::ASLCTRL_DEBUG(ASLCTRL_DEBUG_DATA::random(rng))),
37296 ASLUAV_STATUS_DATA::ID => Some(Self::ASLUAV_STATUS(ASLUAV_STATUS_DATA::random(rng))),
37297 ASL_OBCTRL_DATA::ID => Some(Self::ASL_OBCTRL(ASL_OBCTRL_DATA::random(rng))),
37298 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
37299 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
37300 ATTITUDE_QUATERNION_DATA::random(rng),
37301 )),
37302 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
37303 ATTITUDE_QUATERNION_COV_DATA::random(rng),
37304 )),
37305 ATTITUDE_TARGET_DATA::ID => {
37306 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
37307 }
37308 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
37309 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
37310 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
37311 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
37312 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
37313 ))
37314 }
37315 AUTOPILOT_VERSION_DATA::ID => {
37316 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
37317 }
37318 AVAILABLE_MODES_DATA::ID => {
37319 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
37320 }
37321 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
37322 AVAILABLE_MODES_MONITOR_DATA::random(rng),
37323 )),
37324 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
37325 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
37326 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
37327 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
37328 CAMERA_CAPTURE_STATUS_DATA::random(rng),
37329 )),
37330 CAMERA_FOV_STATUS_DATA::ID => {
37331 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
37332 }
37333 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
37334 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
37335 )),
37336 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
37337 CAMERA_INFORMATION_DATA::random(rng),
37338 )),
37339 CAMERA_SETTINGS_DATA::ID => {
37340 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
37341 }
37342 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
37343 CAMERA_THERMAL_RANGE_DATA::random(rng),
37344 )),
37345 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
37346 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
37347 )),
37348 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
37349 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
37350 )),
37351 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
37352 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
37353 CAN_FILTER_MODIFY_DATA::ID => {
37354 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
37355 }
37356 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
37357 CELLULAR_CONFIG_DATA::ID => {
37358 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
37359 }
37360 CELLULAR_STATUS_DATA::ID => {
37361 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
37362 }
37363 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
37364 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
37365 )),
37366 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
37367 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
37368 )),
37369 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
37370 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
37371 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
37372 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
37373 COMMAND_INT_STAMPED_DATA::ID => Some(Self::COMMAND_INT_STAMPED(
37374 COMMAND_INT_STAMPED_DATA::random(rng),
37375 )),
37376 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
37377 COMMAND_LONG_STAMPED_DATA::ID => Some(Self::COMMAND_LONG_STAMPED(
37378 COMMAND_LONG_STAMPED_DATA::random(rng),
37379 )),
37380 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
37381 COMPONENT_INFORMATION_DATA::random(rng),
37382 )),
37383 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
37384 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
37385 )),
37386 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
37387 COMPONENT_METADATA_DATA::random(rng),
37388 )),
37389 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
37390 CONTROL_SYSTEM_STATE_DATA::random(rng),
37391 )),
37392 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
37393 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
37394 )),
37395 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
37396 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
37397 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
37398 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
37399 )),
37400 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
37401 DEBUG_FLOAT_ARRAY_DATA::ID => {
37402 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
37403 }
37404 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
37405 DISTANCE_SENSOR_DATA::ID => {
37406 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
37407 }
37408 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
37409 EKF_EXT_DATA::ID => Some(Self::EKF_EXT(EKF_EXT_DATA::random(rng))),
37410 ENCAPSULATED_DATA_DATA::ID => {
37411 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
37412 }
37413 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
37414 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
37415 ESTIMATOR_STATUS_DATA::ID => {
37416 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
37417 }
37418 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
37419 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
37420 EXTENDED_SYS_STATE_DATA::random(rng),
37421 )),
37422 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
37423 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
37424 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
37425 )),
37426 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
37427 FLIGHT_INFORMATION_DATA::random(rng),
37428 )),
37429 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
37430 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
37431 FW_SOARING_DATA_DATA::ID => {
37432 Some(Self::FW_SOARING_DATA(FW_SOARING_DATA_DATA::random(rng)))
37433 }
37434 GENERATOR_STATUS_DATA::ID => {
37435 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
37436 }
37437 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
37438 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
37439 )),
37440 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
37441 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
37442 )),
37443 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
37444 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
37445 )),
37446 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
37447 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
37448 )),
37449 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
37450 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
37451 )),
37452 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
37453 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
37454 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
37455 ))
37456 }
37457 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
37458 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
37459 )),
37460 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
37461 GIMBAL_MANAGER_STATUS_DATA::random(rng),
37462 )),
37463 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
37464 GLOBAL_POSITION_INT_DATA::random(rng),
37465 )),
37466 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
37467 GLOBAL_POSITION_INT_COV_DATA::random(rng),
37468 )),
37469 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
37470 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
37471 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
37472 ))
37473 }
37474 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
37475 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
37476 GPS_GLOBAL_ORIGIN_DATA::ID => {
37477 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
37478 }
37479 GPS_INJECT_DATA_DATA::ID => {
37480 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
37481 }
37482 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
37483 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
37484 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
37485 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
37486 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
37487 GSM_LINK_STATUS_DATA::ID => {
37488 Some(Self::GSM_LINK_STATUS(GSM_LINK_STATUS_DATA::random(rng)))
37489 }
37490 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
37491 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
37492 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
37493 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
37494 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
37495 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
37496 )),
37497 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
37498 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
37499 HIL_OPTICAL_FLOW_DATA::ID => {
37500 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
37501 }
37502 HIL_RC_INPUTS_RAW_DATA::ID => {
37503 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
37504 }
37505 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
37506 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
37507 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
37508 HIL_STATE_QUATERNION_DATA::random(rng),
37509 )),
37510 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
37511 HYGROMETER_SENSOR_DATA::ID => {
37512 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
37513 }
37514 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
37515 ILLUMINATOR_STATUS_DATA::random(rng),
37516 )),
37517 ISBD_LINK_STATUS_DATA::ID => {
37518 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
37519 }
37520 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
37521 LINK_NODE_STATUS_DATA::ID => {
37522 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
37523 }
37524 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
37525 LOCAL_POSITION_NED_DATA::random(rng),
37526 )),
37527 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
37528 LOCAL_POSITION_NED_COV_DATA::random(rng),
37529 )),
37530 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
37531 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
37532 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
37533 ))
37534 }
37535 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
37536 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
37537 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
37538 LOGGING_DATA_ACKED_DATA::random(rng),
37539 )),
37540 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
37541 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
37542 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
37543 LOG_REQUEST_DATA_DATA::ID => {
37544 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
37545 }
37546 LOG_REQUEST_END_DATA::ID => {
37547 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
37548 }
37549 LOG_REQUEST_LIST_DATA::ID => {
37550 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
37551 }
37552 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
37553 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
37554 MANUAL_SETPOINT_DATA::ID => {
37555 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
37556 }
37557 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
37558 MESSAGE_INTERVAL_DATA::ID => {
37559 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
37560 }
37561 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
37562 MISSION_CLEAR_ALL_DATA::ID => {
37563 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
37564 }
37565 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
37566 MISSION_CURRENT_DATA::ID => {
37567 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
37568 }
37569 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
37570 MISSION_ITEM_INT_DATA::ID => {
37571 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
37572 }
37573 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
37574 MISSION_ITEM_REACHED_DATA::random(rng),
37575 )),
37576 MISSION_REQUEST_DATA::ID => {
37577 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
37578 }
37579 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
37580 MISSION_REQUEST_INT_DATA::random(rng),
37581 )),
37582 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
37583 MISSION_REQUEST_LIST_DATA::random(rng),
37584 )),
37585 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
37586 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
37587 )),
37588 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
37589 MISSION_SET_CURRENT_DATA::random(rng),
37590 )),
37591 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
37592 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
37593 )),
37594 MOUNT_ORIENTATION_DATA::ID => {
37595 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
37596 }
37597 NAMED_VALUE_FLOAT_DATA::ID => {
37598 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
37599 }
37600 NAMED_VALUE_INT_DATA::ID => {
37601 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
37602 }
37603 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
37604 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
37605 )),
37606 OBSTACLE_DISTANCE_DATA::ID => {
37607 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
37608 }
37609 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
37610 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
37611 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
37612 )),
37613 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
37614 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
37615 )),
37616 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
37617 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
37618 )),
37619 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
37620 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
37621 )),
37622 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
37623 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
37624 )),
37625 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
37626 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
37627 )),
37628 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
37629 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
37630 )),
37631 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
37632 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
37633 )),
37634 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
37635 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
37636 )),
37637 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
37638 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
37639 )),
37640 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
37641 OPTICAL_FLOW_RAD_DATA::ID => {
37642 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
37643 }
37644 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
37645 ORBIT_EXECUTION_STATUS_DATA::random(rng),
37646 )),
37647 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
37648 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
37649 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
37650 )),
37651 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
37652 PARAM_EXT_REQUEST_READ_DATA::random(rng),
37653 )),
37654 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
37655 PARAM_EXT_VALUE_DATA::ID => {
37656 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
37657 }
37658 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
37659 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
37660 PARAM_REQUEST_LIST_DATA::random(rng),
37661 )),
37662 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
37663 PARAM_REQUEST_READ_DATA::random(rng),
37664 )),
37665 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
37666 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
37667 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
37668 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
37669 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
37670 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
37671 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
37672 )),
37673 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
37674 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
37675 )),
37676 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
37677 PROTOCOL_VERSION_DATA::ID => {
37678 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
37679 }
37680 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
37681 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
37682 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
37683 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
37684 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
37685 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
37686 RC_CHANNELS_OVERRIDE_DATA::random(rng),
37687 )),
37688 RC_CHANNELS_RAW_DATA::ID => {
37689 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
37690 }
37691 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
37692 RC_CHANNELS_SCALED_DATA::random(rng),
37693 )),
37694 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
37695 REQUEST_DATA_STREAM_DATA::random(rng),
37696 )),
37697 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
37698 RESOURCE_REQUEST_DATA::ID => {
37699 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
37700 }
37701 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
37702 RESPONSE_EVENT_ERROR_DATA::random(rng),
37703 )),
37704 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
37705 SAFETY_ALLOWED_AREA_DATA::random(rng),
37706 )),
37707 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
37708 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
37709 )),
37710 SATCOM_LINK_STATUS_DATA::ID => Some(Self::SATCOM_LINK_STATUS(
37711 SATCOM_LINK_STATUS_DATA::random(rng),
37712 )),
37713 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
37714 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
37715 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
37716 SCALED_PRESSURE_DATA::ID => {
37717 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
37718 }
37719 SCALED_PRESSURE2_DATA::ID => {
37720 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
37721 }
37722 SCALED_PRESSURE3_DATA::ID => {
37723 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
37724 }
37725 SENSORPOD_STATUS_DATA::ID => {
37726 Some(Self::SENSORPOD_STATUS(SENSORPOD_STATUS_DATA::random(rng)))
37727 }
37728 SENSOR_AIRFLOW_ANGLES_DATA::ID => Some(Self::SENSOR_AIRFLOW_ANGLES(
37729 SENSOR_AIRFLOW_ANGLES_DATA::random(rng),
37730 )),
37731 SENS_ATMOS_DATA::ID => Some(Self::SENS_ATMOS(SENS_ATMOS_DATA::random(rng))),
37732 SENS_BATMON_DATA::ID => Some(Self::SENS_BATMON(SENS_BATMON_DATA::random(rng))),
37733 SENS_MPPT_DATA::ID => Some(Self::SENS_MPPT(SENS_MPPT_DATA::random(rng))),
37734 SENS_POWER_DATA::ID => Some(Self::SENS_POWER(SENS_POWER_DATA::random(rng))),
37735 SENS_POWER_BOARD_DATA::ID => {
37736 Some(Self::SENS_POWER_BOARD(SENS_POWER_BOARD_DATA::random(rng)))
37737 }
37738 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
37739 SERVO_OUTPUT_RAW_DATA::ID => {
37740 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
37741 }
37742 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
37743 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
37744 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
37745 )),
37746 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
37747 SET_ATTITUDE_TARGET_DATA::random(rng),
37748 )),
37749 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
37750 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
37751 )),
37752 SET_HOME_POSITION_DATA::ID => {
37753 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
37754 }
37755 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
37756 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
37757 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
37758 )),
37759 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
37760 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
37761 )),
37762 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
37763 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
37764 SMART_BATTERY_INFO_DATA::random(rng),
37765 )),
37766 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
37767 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
37768 STORAGE_INFORMATION_DATA::random(rng),
37769 )),
37770 SUPPORTED_TUNES_DATA::ID => {
37771 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
37772 }
37773 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
37774 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
37775 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
37776 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
37777 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
37778 TERRAIN_REQUEST_DATA::ID => {
37779 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
37780 }
37781 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
37782 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
37783 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
37784 )),
37785 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
37786 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
37787 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
37788 ))
37789 }
37790 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
37791 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
37792 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
37793 ))
37794 }
37795 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
37796 UAVCAN_NODE_INFO_DATA::ID => {
37797 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
37798 }
37799 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
37800 UAVCAN_NODE_STATUS_DATA::random(rng),
37801 )),
37802 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
37803 UTM_GLOBAL_POSITION_DATA::random(rng),
37804 )),
37805 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
37806 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
37807 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
37808 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
37809 VICON_POSITION_ESTIMATE_DATA::random(rng),
37810 )),
37811 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
37812 VIDEO_STREAM_INFORMATION_DATA::random(rng),
37813 )),
37814 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
37815 VIDEO_STREAM_STATUS_DATA::random(rng),
37816 )),
37817 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
37818 VISION_POSITION_ESTIMATE_DATA::random(rng),
37819 )),
37820 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
37821 VISION_SPEED_ESTIMATE_DATA::random(rng),
37822 )),
37823 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
37824 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
37825 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
37826 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
37827 _ => None,
37828 }
37829 }
37830 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
37831 match self {
37832 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
37833 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
37834 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
37835 Self::AIS_VESSEL(body) => body.ser(version, bytes),
37836 Self::ALTITUDE(body) => body.ser(version, bytes),
37837 Self::ASLCTRL_DATA(body) => body.ser(version, bytes),
37838 Self::ASLCTRL_DEBUG(body) => body.ser(version, bytes),
37839 Self::ASLUAV_STATUS(body) => body.ser(version, bytes),
37840 Self::ASL_OBCTRL(body) => body.ser(version, bytes),
37841 Self::ATTITUDE(body) => body.ser(version, bytes),
37842 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
37843 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
37844 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
37845 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
37846 Self::AUTH_KEY(body) => body.ser(version, bytes),
37847 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
37848 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
37849 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
37850 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
37851 Self::BATTERY_INFO(body) => body.ser(version, bytes),
37852 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
37853 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
37854 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
37855 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
37856 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
37857 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
37858 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
37859 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
37860 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
37861 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
37862 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
37863 Self::CANFD_FRAME(body) => body.ser(version, bytes),
37864 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
37865 Self::CAN_FRAME(body) => body.ser(version, bytes),
37866 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
37867 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
37868 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
37869 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
37870 Self::COLLISION(body) => body.ser(version, bytes),
37871 Self::COMMAND_ACK(body) => body.ser(version, bytes),
37872 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
37873 Self::COMMAND_INT(body) => body.ser(version, bytes),
37874 Self::COMMAND_INT_STAMPED(body) => body.ser(version, bytes),
37875 Self::COMMAND_LONG(body) => body.ser(version, bytes),
37876 Self::COMMAND_LONG_STAMPED(body) => body.ser(version, bytes),
37877 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
37878 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
37879 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
37880 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
37881 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
37882 Self::CURRENT_MODE(body) => body.ser(version, bytes),
37883 Self::DATA_STREAM(body) => body.ser(version, bytes),
37884 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
37885 Self::DEBUG(body) => body.ser(version, bytes),
37886 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
37887 Self::DEBUG_VECT(body) => body.ser(version, bytes),
37888 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
37889 Self::EFI_STATUS(body) => body.ser(version, bytes),
37890 Self::EKF_EXT(body) => body.ser(version, bytes),
37891 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
37892 Self::ESC_INFO(body) => body.ser(version, bytes),
37893 Self::ESC_STATUS(body) => body.ser(version, bytes),
37894 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
37895 Self::EVENT(body) => body.ser(version, bytes),
37896 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
37897 Self::FENCE_STATUS(body) => body.ser(version, bytes),
37898 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
37899 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
37900 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
37901 Self::FUEL_STATUS(body) => body.ser(version, bytes),
37902 Self::FW_SOARING_DATA(body) => body.ser(version, bytes),
37903 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
37904 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
37905 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
37906 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
37907 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
37908 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
37909 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
37910 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
37911 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
37912 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
37913 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
37914 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
37915 Self::GPS2_RAW(body) => body.ser(version, bytes),
37916 Self::GPS2_RTK(body) => body.ser(version, bytes),
37917 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
37918 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
37919 Self::GPS_INPUT(body) => body.ser(version, bytes),
37920 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
37921 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
37922 Self::GPS_RTK(body) => body.ser(version, bytes),
37923 Self::GPS_STATUS(body) => body.ser(version, bytes),
37924 Self::GSM_LINK_STATUS(body) => body.ser(version, bytes),
37925 Self::HEARTBEAT(body) => body.ser(version, bytes),
37926 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
37927 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
37928 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
37929 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
37930 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
37931 Self::HIL_GPS(body) => body.ser(version, bytes),
37932 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
37933 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
37934 Self::HIL_SENSOR(body) => body.ser(version, bytes),
37935 Self::HIL_STATE(body) => body.ser(version, bytes),
37936 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
37937 Self::HOME_POSITION(body) => body.ser(version, bytes),
37938 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
37939 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
37940 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
37941 Self::LANDING_TARGET(body) => body.ser(version, bytes),
37942 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
37943 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
37944 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
37945 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
37946 Self::LOGGING_ACK(body) => body.ser(version, bytes),
37947 Self::LOGGING_DATA(body) => body.ser(version, bytes),
37948 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
37949 Self::LOG_DATA(body) => body.ser(version, bytes),
37950 Self::LOG_ENTRY(body) => body.ser(version, bytes),
37951 Self::LOG_ERASE(body) => body.ser(version, bytes),
37952 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
37953 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
37954 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
37955 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
37956 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
37957 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
37958 Self::MEMORY_VECT(body) => body.ser(version, bytes),
37959 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
37960 Self::MISSION_ACK(body) => body.ser(version, bytes),
37961 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
37962 Self::MISSION_COUNT(body) => body.ser(version, bytes),
37963 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
37964 Self::MISSION_ITEM(body) => body.ser(version, bytes),
37965 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
37966 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
37967 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
37968 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
37969 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
37970 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
37971 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
37972 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
37973 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
37974 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
37975 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
37976 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
37977 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
37978 Self::ODOMETRY(body) => body.ser(version, bytes),
37979 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
37980 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
37981 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
37982 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
37983 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
37984 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
37985 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
37986 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
37987 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
37988 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
37989 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
37990 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
37991 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
37992 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
37993 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
37994 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
37995 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
37996 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
37997 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
37998 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
37999 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
38000 Self::PARAM_SET(body) => body.ser(version, bytes),
38001 Self::PARAM_VALUE(body) => body.ser(version, bytes),
38002 Self::PING(body) => body.ser(version, bytes),
38003 Self::PLAY_TUNE(body) => body.ser(version, bytes),
38004 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
38005 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
38006 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
38007 Self::POWER_STATUS(body) => body.ser(version, bytes),
38008 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
38009 Self::RADIO_STATUS(body) => body.ser(version, bytes),
38010 Self::RAW_IMU(body) => body.ser(version, bytes),
38011 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
38012 Self::RAW_RPM(body) => body.ser(version, bytes),
38013 Self::RC_CHANNELS(body) => body.ser(version, bytes),
38014 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
38015 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
38016 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
38017 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
38018 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
38019 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
38020 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
38021 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
38022 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
38023 Self::SATCOM_LINK_STATUS(body) => body.ser(version, bytes),
38024 Self::SCALED_IMU(body) => body.ser(version, bytes),
38025 Self::SCALED_IMU2(body) => body.ser(version, bytes),
38026 Self::SCALED_IMU3(body) => body.ser(version, bytes),
38027 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
38028 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
38029 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
38030 Self::SENSORPOD_STATUS(body) => body.ser(version, bytes),
38031 Self::SENSOR_AIRFLOW_ANGLES(body) => body.ser(version, bytes),
38032 Self::SENS_ATMOS(body) => body.ser(version, bytes),
38033 Self::SENS_BATMON(body) => body.ser(version, bytes),
38034 Self::SENS_MPPT(body) => body.ser(version, bytes),
38035 Self::SENS_POWER(body) => body.ser(version, bytes),
38036 Self::SENS_POWER_BOARD(body) => body.ser(version, bytes),
38037 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
38038 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
38039 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
38040 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
38041 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
38042 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
38043 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
38044 Self::SET_MODE(body) => body.ser(version, bytes),
38045 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
38046 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
38047 Self::SIM_STATE(body) => body.ser(version, bytes),
38048 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
38049 Self::STATUSTEXT(body) => body.ser(version, bytes),
38050 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
38051 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
38052 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
38053 Self::SYS_STATUS(body) => body.ser(version, bytes),
38054 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
38055 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
38056 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
38057 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
38058 Self::TIMESYNC(body) => body.ser(version, bytes),
38059 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
38060 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
38061 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
38062 Self::TUNNEL(body) => body.ser(version, bytes),
38063 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
38064 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
38065 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
38066 Self::V2_EXTENSION(body) => body.ser(version, bytes),
38067 Self::VFR_HUD(body) => body.ser(version, bytes),
38068 Self::VIBRATION(body) => body.ser(version, bytes),
38069 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
38070 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
38071 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
38072 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
38073 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
38074 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
38075 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
38076 Self::WINCH_STATUS(body) => body.ser(version, bytes),
38077 Self::WIND_COV(body) => body.ser(version, bytes),
38078 }
38079 }
38080 fn extra_crc(id: u32) -> u8 {
38081 match id {
38082 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
38083 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
38084 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
38085 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
38086 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
38087 ASLCTRL_DATA_DATA::ID => ASLCTRL_DATA_DATA::EXTRA_CRC,
38088 ASLCTRL_DEBUG_DATA::ID => ASLCTRL_DEBUG_DATA::EXTRA_CRC,
38089 ASLUAV_STATUS_DATA::ID => ASLUAV_STATUS_DATA::EXTRA_CRC,
38090 ASL_OBCTRL_DATA::ID => ASL_OBCTRL_DATA::EXTRA_CRC,
38091 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
38092 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
38093 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
38094 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
38095 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
38096 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
38097 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
38098 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
38099 }
38100 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
38101 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
38102 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
38103 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
38104 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
38105 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
38106 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
38107 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
38108 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
38109 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
38110 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
38111 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
38112 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
38113 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
38114 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
38115 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
38116 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
38117 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
38118 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
38119 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
38120 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
38121 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
38122 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
38123 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
38124 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
38125 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
38126 COMMAND_INT_STAMPED_DATA::ID => COMMAND_INT_STAMPED_DATA::EXTRA_CRC,
38127 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
38128 COMMAND_LONG_STAMPED_DATA::ID => COMMAND_LONG_STAMPED_DATA::EXTRA_CRC,
38129 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
38130 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
38131 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
38132 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
38133 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
38134 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
38135 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
38136 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
38137 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
38138 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
38139 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
38140 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
38141 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
38142 EKF_EXT_DATA::ID => EKF_EXT_DATA::EXTRA_CRC,
38143 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
38144 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
38145 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
38146 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
38147 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
38148 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
38149 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
38150 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
38151 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
38152 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
38153 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
38154 FW_SOARING_DATA_DATA::ID => FW_SOARING_DATA_DATA::EXTRA_CRC,
38155 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
38156 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
38157 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
38158 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
38159 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
38160 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
38161 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
38162 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
38163 }
38164 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
38165 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
38166 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
38167 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
38168 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
38169 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
38170 }
38171 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
38172 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
38173 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
38174 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
38175 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
38176 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
38177 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
38178 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
38179 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
38180 GSM_LINK_STATUS_DATA::ID => GSM_LINK_STATUS_DATA::EXTRA_CRC,
38181 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
38182 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
38183 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
38184 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
38185 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
38186 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
38187 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
38188 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
38189 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
38190 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
38191 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
38192 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
38193 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
38194 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
38195 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
38196 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
38197 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
38198 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
38199 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
38200 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
38201 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
38202 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
38203 }
38204 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
38205 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
38206 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
38207 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
38208 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
38209 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
38210 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
38211 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
38212 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
38213 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
38214 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
38215 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
38216 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
38217 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
38218 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
38219 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
38220 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
38221 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
38222 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
38223 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
38224 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
38225 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
38226 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
38227 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
38228 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
38229 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
38230 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
38231 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
38232 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
38233 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
38234 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
38235 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
38236 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
38237 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
38238 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
38239 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
38240 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
38241 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
38242 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
38243 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
38244 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
38245 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
38246 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
38247 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
38248 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
38249 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
38250 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
38251 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
38252 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
38253 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
38254 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
38255 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
38256 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
38257 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
38258 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
38259 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
38260 PING_DATA::ID => PING_DATA::EXTRA_CRC,
38261 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
38262 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
38263 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
38264 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
38265 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
38266 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
38267 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
38268 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
38269 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
38270 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
38271 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
38272 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
38273 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
38274 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
38275 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
38276 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
38277 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
38278 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
38279 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
38280 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
38281 SATCOM_LINK_STATUS_DATA::ID => SATCOM_LINK_STATUS_DATA::EXTRA_CRC,
38282 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
38283 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
38284 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
38285 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
38286 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
38287 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
38288 SENSORPOD_STATUS_DATA::ID => SENSORPOD_STATUS_DATA::EXTRA_CRC,
38289 SENSOR_AIRFLOW_ANGLES_DATA::ID => SENSOR_AIRFLOW_ANGLES_DATA::EXTRA_CRC,
38290 SENS_ATMOS_DATA::ID => SENS_ATMOS_DATA::EXTRA_CRC,
38291 SENS_BATMON_DATA::ID => SENS_BATMON_DATA::EXTRA_CRC,
38292 SENS_MPPT_DATA::ID => SENS_MPPT_DATA::EXTRA_CRC,
38293 SENS_POWER_DATA::ID => SENS_POWER_DATA::EXTRA_CRC,
38294 SENS_POWER_BOARD_DATA::ID => SENS_POWER_BOARD_DATA::EXTRA_CRC,
38295 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
38296 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
38297 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
38298 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
38299 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
38300 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
38301 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
38302 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
38303 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
38304 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
38305 }
38306 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
38307 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
38308 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
38309 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
38310 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
38311 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
38312 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
38313 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
38314 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
38315 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
38316 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
38317 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
38318 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
38319 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
38320 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
38321 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
38322 }
38323 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
38324 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
38325 }
38326 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
38327 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
38328 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
38329 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
38330 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
38331 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
38332 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
38333 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
38334 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
38335 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
38336 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
38337 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
38338 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
38339 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
38340 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
38341 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
38342 _ => 0,
38343 }
38344 }
38345 fn target_system_id(&self) -> Option<u8> {
38346 match self {
38347 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
38348 Self::CANFD_FRAME(inner) => Some(inner.target_system),
38349 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
38350 Self::CAN_FRAME(inner) => Some(inner.target_system),
38351 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
38352 Self::COMMAND_ACK(inner) => Some(inner.target_system),
38353 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
38354 Self::COMMAND_INT(inner) => Some(inner.target_system),
38355 Self::COMMAND_INT_STAMPED(inner) => Some(inner.target_system),
38356 Self::COMMAND_LONG(inner) => Some(inner.target_system),
38357 Self::COMMAND_LONG_STAMPED(inner) => Some(inner.target_system),
38358 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
38359 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
38360 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
38361 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
38362 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
38363 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
38364 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
38365 Self::LOGGING_ACK(inner) => Some(inner.target_system),
38366 Self::LOGGING_DATA(inner) => Some(inner.target_system),
38367 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
38368 Self::LOG_ERASE(inner) => Some(inner.target_system),
38369 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
38370 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
38371 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
38372 Self::MISSION_ACK(inner) => Some(inner.target_system),
38373 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
38374 Self::MISSION_COUNT(inner) => Some(inner.target_system),
38375 Self::MISSION_ITEM(inner) => Some(inner.target_system),
38376 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
38377 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
38378 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
38379 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
38380 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
38381 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
38382 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
38383 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
38384 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
38385 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
38386 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
38387 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
38388 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
38389 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
38390 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
38391 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
38392 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
38393 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
38394 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
38395 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
38396 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
38397 Self::PARAM_SET(inner) => Some(inner.target_system),
38398 Self::PING(inner) => Some(inner.target_system),
38399 Self::PLAY_TUNE(inner) => Some(inner.target_system),
38400 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
38401 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
38402 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
38403 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
38404 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
38405 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
38406 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
38407 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
38408 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
38409 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
38410 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
38411 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
38412 Self::SET_MODE(inner) => Some(inner.target_system),
38413 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
38414 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
38415 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
38416 Self::TIMESYNC(inner) => Some(inner.target_system),
38417 Self::TUNNEL(inner) => Some(inner.target_system),
38418 Self::V2_EXTENSION(inner) => Some(inner.target_system),
38419 _ => None,
38420 }
38421 }
38422 fn target_component_id(&self) -> Option<u8> {
38423 match self {
38424 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
38425 Self::CANFD_FRAME(inner) => Some(inner.target_component),
38426 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
38427 Self::CAN_FRAME(inner) => Some(inner.target_component),
38428 Self::COMMAND_ACK(inner) => Some(inner.target_component),
38429 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
38430 Self::COMMAND_INT(inner) => Some(inner.target_component),
38431 Self::COMMAND_INT_STAMPED(inner) => Some(inner.target_component),
38432 Self::COMMAND_LONG(inner) => Some(inner.target_component),
38433 Self::COMMAND_LONG_STAMPED(inner) => Some(inner.target_component),
38434 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
38435 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
38436 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
38437 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
38438 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
38439 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
38440 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
38441 Self::LOGGING_ACK(inner) => Some(inner.target_component),
38442 Self::LOGGING_DATA(inner) => Some(inner.target_component),
38443 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
38444 Self::LOG_ERASE(inner) => Some(inner.target_component),
38445 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
38446 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
38447 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
38448 Self::MISSION_ACK(inner) => Some(inner.target_component),
38449 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
38450 Self::MISSION_COUNT(inner) => Some(inner.target_component),
38451 Self::MISSION_ITEM(inner) => Some(inner.target_component),
38452 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
38453 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
38454 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
38455 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
38456 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
38457 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
38458 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
38459 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
38460 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
38461 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
38462 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
38463 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
38464 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
38465 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
38466 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
38467 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
38468 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
38469 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
38470 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
38471 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
38472 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
38473 Self::PARAM_SET(inner) => Some(inner.target_component),
38474 Self::PING(inner) => Some(inner.target_component),
38475 Self::PLAY_TUNE(inner) => Some(inner.target_component),
38476 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
38477 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
38478 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
38479 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
38480 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
38481 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
38482 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
38483 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
38484 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
38485 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
38486 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
38487 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
38488 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
38489 Self::TIMESYNC(inner) => Some(inner.target_component),
38490 Self::TUNNEL(inner) => Some(inner.target_component),
38491 Self::V2_EXTENSION(inner) => Some(inner.target_component),
38492 _ => None,
38493 }
38494 }
38495}